加载包含Newtonsoft程序集且反射错误的dll [英] Loading dll that contains Newtonsoft assembly with reflection error

查看:57
本文介绍了加载包含Newtonsoft程序集且反射错误的dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用使用Newtonsoft的ISerializationBinder活页夹的反射来加载程序集,但是在加载程序集时会引发以下异常:

I'm trying to load an assembly using reflection that uses the ISerializationBinder binder from Newtonsoft, but when the assembly is loaded it throws the following exception:

System.Reflection.ReflectionTypeLoadException:'无法加载一个或 更多要求的类型.无法加载类型 程序集"Newtonsoft.Json"中的"Newtonsoft.Json.SerializationBinder", 版本= 11.0.0.0,文化为中性,PublicKeyToken = 30ad4fe6b2a6aeed".

System.Reflection.ReflectionTypeLoadException: 'Unable to load one or more of the requested types. Could not load type 'Newtonsoft.Json.SerializationBinder' from assembly 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.'

我真的不知道为什么会这样

I don't really have a clue of why it could be

推荐答案

老实说,我还是很困惑,但是我做了一个干净的工作,然后构建了我要加载的程序集,这似乎摆脱了旧的束缚SerializationBinder类.

Well, honestly I'm still confused but I did a clean and then build of the assembly I was trying to load and that seemed to get rid of the old SerializationBinder class.

这篇关于加载包含Newtonsoft程序集且反射错误的dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆