2014-03-30 2 views
0

System.Collections.Generic.List (Iserialization)를 사용하는 dll을 가져 오려고하는데 클래스가 호출 될 때마다 다음 예외가 발생합니다.ddl 가져 오기, 컴파일하지만 응용 프로그램에서 호출 할 때 System.TypeLoadException 예외가 발생합니다.

Exception: System.TypeLoadException: Could not load type 'System.Collections.Generic.List`1[[SD_Library.PLItem, SD Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]'. 
    at (wrapper managed-to-native) System.Type:internal_from_name (string,bool,bool) 
    at System.Type.GetType (System.String typeName, Boolean throwOnError) [0x00011] in /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System/Type.cs:471 
    at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadTypeMetadata (System.IO.BinaryReader reader, Boolean isRuntimeObject, Boolean hasTypeInfo) [0x000bc] in /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:640 
    at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectInstance (System.IO.BinaryReader reader, Boolean isRuntimeObject, Boolean hasTypeInfo, System.Int64& objectId, System.Object& value, System.Runtime.Serialization.SerializationInfo& info) [0x0000a] in /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:269 
    at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObject (BinaryElement element, System.IO.BinaryReader reader, System.Int64& objectId, System.Object& value, System.Runtime.Serialization.SerializationInfo& info) [0x0008a] in /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:191 
    at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObject (BinaryElement element, System.IO.BinaryReader reader, System.Int64& objectId, System.Object& value, System.Runtime.Serialization.SerializationInfo& info) [0x00105] in /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:223 
    at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObject (BinaryElement element, System.IO.BinaryReader reader) [0x00020] in /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:130 
    at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectGraph (BinaryElement elem, System.IO.BinaryReader reader, Boolean readHeaders, System.Object& result, System.Runtime.Remoting.Messaging.Header[]& headers) [0x00004] in /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:104 
    at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.NoCheckDeserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00078] in /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs:179 
    at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream) [0x00000] in /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs:136 
    at GameManager.OpenStream (System.String saveLocation) [0x0003c] in C:\Users\Chris\Documents\Repositories\PL2D\Assets\Scripts\GameManager.cs:568 
UnityEngine.Debug:LogError(Object) 
GameManager:OpenStream(String) (at Assets/Scripts/GameManager.cs:572) 
GameManager:LoadItemDatabase() (at Assets/Scripts/GameManager.cs:457) 
GameManager:Start() (at Assets/Scripts/GameManager.cs:188) 
GameManager:Awake() (at Assets/Scripts/GameManager.cs:440) 

내가 유니티 4.3.3와 MonoDevelop 4.0.1을 사용하고 있습니다 : 나는 재판의 과거 4시간 오류 후 작동되지 수있다.

제안 사항? 문제 클래스는 꽤 ​​간단합니다. 수레, 줄, int, 한 사전, 한 목록 만 있습니다. 객체가 저장되고 ISerializable과 인터페이스 할 때 Iserialization을 사용합니다. 목록은 Iserializable 인 다른 클래스의 목록입니다.

+1

비정상적인 예외는 예외적 인 설명이 필요합니다. 확실히 "SD Library"어셈블리 이름에서 공백을 제거하는 것으로 시작합니다. –

+0

그게 다야! 결정된! : D 당신이 이것으로 답을 만들면 나는 그것을 올바르게 표시 할 것입니다. 고맙습니다! – Euthyphro

+0

나는 10 피트 극으로 그 하나를 만져보고 싶지 않다. 이것은 Mono 사용자들의 무리를 깍아 내야한다. 직접 자신의 답을 쓰고 프로젝트에 버그를 신고하는 것을 잊지 마십시오. –

답변

0

Visual Studio C# 2010에서는 어셈블리 이름에 공백이 허용되지만 Mono는이를 좋아하지 않았습니다. 이름에서 공백을 삭제하면 모든 문제가 해결되고 이제는 작동합니다.

+0

나만의 답변을 수락 할 수 있습니다. –

관련 문제