我有一個名爲DocumentExplorerControl的自定義用戶控件,它具有多個屬性,其中一個名爲HistoryList。如果我做任何改變,以包含該控件的任何形式,構建就會失敗,出現以下錯誤:Visual Studio錯誤地將數據添加到Resx文件
Invalid Resx file. Could not load type System.Collections.Generic.List`1[[xxxxxx.DocumentManager.IHistoryObject, xxxxxx, Version=4.0.5207.25065, Culture=neutral, PublicKeyToken=null]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 which is used in the .RESX file.
我可以雙擊錯誤,它需要我的問題在.resx文件:
<data name="documentsList.HistoryList" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAJkBQURNU19EZXNrdG9wLCBWZXJzaW9uPTQuMC41MjA3LjI1MDY1
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGxdXSwgbXNjb3JsaWIsIFZlcnNpb249
NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5DAMA
AABKQURNU19EZXNrdG9wLCBWZXJzaW9uPTQuMC41MjA3LjI1MDY1LCBDdWx0dXJlPW5ldXRyYWwsIFB1
YmxpY0tleVRva2VuPW51bGwFAQAAAE5TeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5MaXN0YDFbW0FE
TVNfRGVza3RvcC5Eb2N1bWVudE1hbmFnZXIuSUhpc3RvcnlPYmplY3QDAAAABl9pdGVtcwVfc2l6ZQhf
dmVyc2lvbgQAAC1BRE1TX0Rlc2t0b3AuRG9jdW1lbnRNYW5hZ2VyLklIaXN0b3J5T2JqZWN0W10DAAAA
CAgCAAAACQQAAAAAAAAAAAAAAAcEAAAAAAEAAAAAAAAABCtBRE1TX0Rlc2t0b3AuRG9jdW1lbnRNYW5h
Z2VyLklIaXN0b3J5T2JqZWN0AwAAAAs=
</value>
</data>
這是從此控件添加到.resx文件中的唯一屬性,如果我刪除此添加的數據部分,則應用程序生成並運行得很好。
在兩個不同的計算機和兩個不同的用戶上,Visual Studio 2012和2013都出現此問題。破損的.resx文件不會阻止設計器中的任何內容正常工作。有沒有人知道可能會造成這種情況?我已經爲下面的HistoryList的所有屬性添加了簽名。
HistoryList:
Public Property HistoryList As List(Of IHistoryObject)
IHistoryObject:
Public Interface IHistoryObject
Property FolderList As List(Of IFolder)
Property DocumentList As List(Of IDocument)
Property DefaultHandler As IDocumentHandler
Property FolderName As String
End Interface
的iFolder:
Public Interface IFolder
Property FolderName() As String
Property SubFolders() As List(Of IFolder)
Property Documents() As List(Of IDocument)
Property DefaultDocumentHandler() As IDocumentHandler
End Interface
的IDocument:
Public Interface IDocument
Property DocumentName() As String
Property DocumentType() As DocumentType
Property DocumentLocation() As DocumentLocation
Property ScreenLocation() As ScreenLocation
Property DocumentIdentifier() As String
Property Compressed() As Boolean
Property DocumentHandler() As IDocumentHandler
Property UsedDocumentId() As Integer
Property PrivateDocument() As Boolean
Property SavedDate() As DateTime
Property KnowledgeLakeDocumentTypeId() As Integer?
Property KnowledgeLakeDocumentClassId() As Integer?
Property RequiresFollowUp() As Boolean
Property Comments() As String
Property DevelopmentKey() As Integer
Property Version() As Integer
Property MonitoringId() As Integer?
Property FollowUpDate() As Date?
Property FollowUpUsers As List(Of Integer)
End Interface
IDocumentHandler:
Public Interface IDocumentHandler
Sub Open(document As IDocument)
Sub OpenVersion(sourceTableId As Integer, fileName As String)
Function Delete(document As IDocument, Optional saveHistory As Boolean = True) As DocumentAddReturnData
Sub SaveToDisk(document As IDocument, filePath As String, openWhenDone As Boolean)
Function Add(documentBinary As Byte(), ByRef document As IDocument) As DocumentAddReturnData
Function Replace(existingDocument As IDocument, newDocument As Byte(), fileName As String) As DocumentAddReturnData
Function Replace(documentId As Integer, newDocument As Byte()) As DocumentAddReturnData
Function FileNameExists(fileName As String, Optional developmentKey As Integer = 0, Optional monitoringKey As Integer = 0) As DocumentConstants.FileNameExists
Function FilePathExists(filePath As String, Optional developmentKey As Integer = 0, Optional monitoringKey As Integer = 0) As DocumentConstants.FileNameExists
Function AppendFileNumber(fileName As String, Optional developmentKey As Integer = 0, Optional monitoringKey As Integer = 0) As String
End Interface
感謝您的解釋。控件和表單在同一個項目中,所以我不知道這是否相關。感謝這個屬性。將在設計模式測試中轉換到這一點......說實話並不合適。 –