-Fixed deserializing with type name handling and assemblies loaded with Assembly.LoadFrom
This commit is contained in:
@@ -75,4 +75,4 @@ using System.Security;
|
|||||||
// You can specify all the values or you can default the Revision and Build Numbers
|
// You can specify all the values or you can default the Revision and Build Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
[assembly: AssemblyVersion("4.5.0.0")]
|
[assembly: AssemblyVersion("4.5.0.0")]
|
||||||
[assembly: AssemblyFileVersion("5.0.4.16101")]
|
[assembly: AssemblyFileVersion("5.0.4.16102")]
|
||||||
|
|||||||
@@ -92,6 +92,6 @@ using System.Security;
|
|||||||
// You can specify all the values or you can default the Revision and Build Numbers
|
// You can specify all the values or you can default the Revision and Build Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
[assembly: AssemblyVersion("4.5.0.0")]
|
[assembly: AssemblyVersion("4.5.0.0")]
|
||||||
[assembly: AssemblyFileVersion("5.0.4.16101")]
|
[assembly: AssemblyFileVersion("5.0.4.16102")]
|
||||||
|
|
||||||
[assembly: CLSCompliant(true)]
|
[assembly: CLSCompliant(true)]
|
||||||
|
|||||||
@@ -61,6 +61,22 @@ namespace Newtonsoft.Json.Serialization
|
|||||||
assembly = Assembly.Load(assemblyName);
|
assembly = Assembly.Load(assemblyName);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !(PORTABLE40 || PORTABLE)
|
||||||
|
if (assembly == null)
|
||||||
|
{
|
||||||
|
// will find assemblies loaded with Assembly.LoadFile outside of the main directory
|
||||||
|
Assembly[] loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies();
|
||||||
|
foreach (Assembly a in loadedAssemblies)
|
||||||
|
{
|
||||||
|
if (a.FullName == assemblyName)
|
||||||
|
{
|
||||||
|
assembly = a;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (assembly == null)
|
if (assembly == null)
|
||||||
throw new JsonSerializationException("Could not load assembly '{0}'.".FormatWith(CultureInfo.InvariantCulture, assemblyName));
|
throw new JsonSerializationException("Could not load assembly '{0}'.".FormatWith(CultureInfo.InvariantCulture, assemblyName));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user