2010-09-20 17 views
1

J'ai un win formes Usercontrol qui est soudainement incapable de construire, avec cette erreur:Le concepteur de Winforms ne parvient pas à trouver l'assembly de projet?

Édition- oublié de mentionner, Le nom du projet est Datatesting, ce n'est pas une référence externe!

Error 1 Invalid Resx file. Could not load type DataTesting.TableColumn, DataTesting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null which is used in the .RESX file. Ensure that the necessary references have been added to your project. Line 129, position 5. C:\Team Explorer\DataTesting\TableColumnListEditor.resx 129 5 DataTesting 

Navigation à l'erreur ouvre à cette section de TableColumnListEditor.resx:

<data name="tableColumnEditor1.EditingTableColumn" mimetype="application/x-microsoft.net.object.binary.base64"> 
    <value> 
     AAEAAAD/////AQAAAAAAAAAMAgAAAEJEYXRhVGVzdGluZywgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJl 
     PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABdEYXRhVGVzdGluZy5UYWJsZUNvbHVtbgYA 
     AAAVPE5hbWU+a19fQmFja2luZ0ZpZWxkGDxTcWxUeXBlPmtfX0JhY2tpbmdGaWVsZBs8RmlsbE1ldGhv 
     ZD5rX19CYWNraW5nRmllbGQaPFByZWNpc2lvbj5rX19CYWNraW5nRmllbGQbPElzSWRlbnRpdHk+a19f 
     QmFja2luZ0ZpZWxkGzxJc051bGxhYmxlPmtfX0JhY2tpbmdGaWVsZAEBAQAAAAUBAQIAAAAGAwAAAAAG 
     BAAAAAAGBQAAAAABMAAACw== 
    </value> 
    </data> 

Enfin, lorsque je tente d'ouvrir le concepteur pour le contrôle, je reçois cette erreur:

To prevent possible data loss before loading the designer, the following errors must be resolved: 



    1 Error 

    Ignore and Continue 
    Why am I seeing this page? 

    Unable to find assembly 'DataTesting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.  

Instances of this error (1) 

1. Show Call Stack 

at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly() 
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name) 
at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable) 
at System.Runtime.Serialization.Formatters.Binary.ObjectMap.Create(String name, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable) 
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record) 
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum) 
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run() 
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) 
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) 
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream) 
at System.Resources.ResXDataNode.GenerateObjectFromDataNodeInfo(DataNodeInfo dataNodeInfo, ITypeResolutionService typeResolver) 
at System.Resources.ResXDataNode.GetValue(ITypeResolutionService typeResolver) 
at System.Resources.ResXResourceReader.ParseDataNode(XmlTextReader reader, Boolean isMetaData) 
at System.Resources.ResXResourceReader.ParseXml(XmlTextReader reader) 

Help with this error 

MSDN Help 


Forum posts about this error 

Search the MSDN Forums for posts related to this error 

Ce formulaire a bien fonctionné pendant un certain temps, et je ne sais pas pourquoi il est soudainement brisé, ou comment corriger ce problème.

Est-ce que quelqu'un d'autre a déjà vu cela et sait peut-être comment résoudre ce problème?

Répondre

3

Vous avez réussi à créer une référence de projet circulaire en quelque sorte. La valeur des ressources ressemble à peu près comme celui-ci, lorsqu'il est converti de base64 en octets:

00000000: 00 01 00 00 00 FF FF FF │ FF 01 00 00 00 00 00 00       
00000010: 00 0C 02 00 00 00 42 44 │ 61 74 61 54 65 73 74 69  BDataTesti 
00000020: 6E 67 2C 20 56 65 72 73 │ 69 6F 6E 3D 31 2E 30 2E ng, Version=1.0. 
00000030: 30 2E 30 2C 20 43 75 6C │ 74 75 72 65 3D 6E 65 75 0.0, Culture=neu 
00000040: 74 72 61 6C 2C 20 50 75 │ 62 6C 69 63 4B 65 79 54 tral, PublicKeyT 
00000050: 6F 6B 65 6E 3D 6E 75 6C │ 6C 05 01 00 00 00 17 44 oken=null D 
00000060: 61 74 61 54 65 73 74 69 │ 6E 67 2E 54 61 62 6C 65 ataTesting.Table 
00000070: 43 6F 6C 75 6D 6E 06 00 │ 00 00 15 3C 4E 61 6D 65 Column <Name 
00000080: 3E 6B 5F 5F 42 61 63 6B │ 69 6E 67 46 69 65 6C 64 >k__BackingField 
00000090: 18 3C 53 71 6C 54 79 70 │ 65 3E 6B 5F 5F 42 61 63 <SqlType>k__Bac 
000000A0: 6B 69 6E 67 46 69 65 6C │ 64 1B 3C 46 69 6C 6C 4D kingField<FillM 
000000B0: 65 74 68 6F 64 3E 6B 5F │ 5F 42 61 63 6B 69 6E 67 ethod>k__Backing 
000000C0: 46 69 65 6C 64 1A 3C 50 │ 72 65 63 69 73 69 6F 6E Field<Precision 
000000D0: 3E 6B 5F 5F 42 61 63 6B │ 69 6E 67 46 69 65 6C 64 >k__BackingField 
000000E0: 1B 3C 49 73 49 64 65 6E │ 74 69 74 79 3E 6B 5F 5F <IsIdentity>k__ 
000000F0: 42 61 63 6B 69 6E 67 46 │ 69 65 6C 64 1B 3C 49 73 BackingField<Is 
00000100: 4E 75 6C 6C 61 62 6C 65 │ 3E 6B 5F 5F 42 61 63 6B Nullable>k__Back 
00000110: 69 6E 67 46 69 65 6C 64 │ 01 01 01 00 00 00 05 01 ingField 
00000120: 01 02 00 00 00 06 03 00 │ 00 00 00 06 04 00 00 00   
00000130: 00 06 05 00 00 00 00 01 │ 30 00 00 0B     0 

Ce sont des données générées par BinaryFormatter, notez qu'il fait référence à l'ensemble DataTesting, l'assemblage que vous essayez de compiler. Cela peut effectivement passer inaperçu pendant un certain temps puisque DataTesting.dll existera pendant que vous éditez votre projet. Jusqu'à ce que vous faites une construction propre et la DLL n'est plus disponible. Kaboom.

Aucune idée de ce que la ressource signifie réellement ou comment vous l'avez eu dans la ressource en premier lieu. Mais vous devrez tourner n'importe quel type stocké ici dans un autre assemblage afin qu'il puisse être construit séparément. La restauration de cette erreur, à court de restaurer une version antérieure à partir de SCCS, pourrait être possible en éditant le fichier .resx à la main et en supprimant la ressource.

+1

Bien que j'aimerais savoir ce que j'ai fait de mal pour arriver à ce point, le déplacement du type référencé vers un projet de bibliothèque séparé et l'inclusion d'une référence à celui-ci l'ont effacé immédiatement. Je vous remercie. – asawyer