tl24 / jsonexserializer

Automatically exported from code.google.com/p/jsonexserializer
1 stars 1 forks source link

Aliasing an open generic type causes an error upon deserializing #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add an alias for an open generic type such as Dictionary<,>

s.Config.TypeAliases.Add(typeof(System.Collections.Generic.Dictionary<,>), 
"dictionary");
2. Serialize some data containing the type
3. Deserialize the data in step 2

An Exception occurs:
Error   60  TestCase 'TypeAliasTests.AliasedOpenGenericType'
failed: Could not load type 'dictionary`2' from assembly 'JsonExSerializer, 
Version=3.1.0.258, Culture=neutral, PublicKeyToken=6be1316762335bd4'.
System.TypeLoadException
Message: Could not load type 'dictionary`2' from assembly 
'JsonExSerializer, Version=3.1.0.258, Culture=neutral, 
PublicKeyToken=6be1316762335bd4'.
Source: mscorlib
StackTrace:
   at System.RuntimeTypeHandle._GetTypeByName(String name, Boolean 
throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& 
stackMark, Boolean loadTypeFromPartialName)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean 
throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& 
stackMark)
   at System.RuntimeType.PrivateGetType(String typeName, Boolean 
throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& 
stackMark)
   at System.Type.GetType(String typeName, Boolean throwOnError)
   at JsonExSerializer.Framework.Parsing.Parser.BindType(String typeName) 
in 
F:\work\c#\JsonExSerializer\JsonExSerializer\Framework\Parsing\Parser.cs:li
ne 441
   at JsonExSerializer.Framework.Parsing.Parser.ParseTypeSpecifier() in 
F:\work\c#\JsonExSerializer\JsonExSerializer\Framework\Parsing\Parser.cs:li
ne 392
   at JsonExSerializer.Framework.Parsing.Parser.ParseCast() in 
F:\work\c#\JsonExSerializer\JsonExSerializer\Framework\Parsing\Parser.cs:li
ne 202
   at JsonExSerializer.Framework.Parsing.Parser.ParseExpression() in 
F:\work\c#\JsonExSerializer\JsonExSerializer\Framework\Parsing\Parser.cs:li
ne 145
   at JsonExSerializer.Framework.Parsing.Parser.Parse() in 
F:\work\c#\JsonExSerializer\JsonExSerializer\Framework\Parsing\Parser.cs:li
ne 92
   at JsonExSerializer.Serializer.Parse(TextReader reader) in 
F:\work\c#\JsonExSerializer\JsonExSerializer\Serializer.cs:line 251
   at JsonExSerializer.Serializer.Deserialize(TextReader reader) in 
F:\work\c#\JsonExSerializer\JsonExSerializer\Serializer.cs:line 227
   at JsonExSerializer.Serializer.Deserialize(String input) in 
F:\work\c#\JsonExSerializer\JsonExSerializer\Serializer.cs:line 284
   at JsonExSerializerTests.TypeAliasTests.AliasedOpenGenericType() in 
F:\work\c#\JsonExSerializer\JsonExSerializerTests\TypeAliasTests.cs:line 65 
F:\work\c#\JsonExSerializer\JsonExSerializer\Framework\Parsing\Parser.cs    
441 

Please use labels and text to provide additional information.

Original issue reported on code.google.com by elliott....@gmail.com on 7 Oct 2009 at 5:35

GoogleCodeExporter commented 9 years ago

Original comment by elliott....@gmail.com on 7 Oct 2009 at 6:08

GoogleCodeExporter commented 9 years ago
Release 3.1

Original comment by elliott....@gmail.com on 16 Apr 2010 at 3:51