积极答复者
未能加载文件或程序集的问题

问题
-
IntelliTrace调试时,报异常: 已引发:“未能加载文件或程序集“ctlSideBar.XmlSerializers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)”(System.IO.FileLoadException) 异常消息 = "未能加载文件或程序集“ctlSideBar.XmlSerializers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)", 异常类型 = "System.IO.FileLoadException"
其中ctlSideBar.dll是我自定义的动态连接库,其中使用到了webservice服务。文件ctlSideBar.XmlSerializers.dll已经生成,那么可能是缺少其依赖项了。应该是哪个依赖项呢?怎么生成呢?我已经将动态链接库和主程序这两个项目的属性中的目标平台都设置成了x86 cpu。还需要检查哪方面的问题呢?请指教,谢谢!
- 已移动 Leo Liu - MSFT 2011年5月6日 8:19 Moved for better support. (发件人:Visual C#)
答案
-
我现将你的问题移到 .NET Framework 一般性问题讨论区 以便得到更好的支持,谢谢.
Leo Liu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 JSHZP 2011年5月11日 11:23
-
你好,
ctlSideBar.XmlSerializers.dll这个程序集是已经存在的,还是在runtime动态生成的,看起来是因为这个程序集与你project中引用的程序集不匹配,或者是这个程序集依赖项不匹配。
如果是固有的程序集,可以移除程序集,重新add后rebuild一下,如若还是不行,需要检查该程序集的platform,看到你设置成了x86了,另外还需检查一下target的.NET Framework版本,是否是主程序支持的,比如主程序是.NET Framework V2.0或者3.5的,加载的程序是target 4.0的话是不可以的。
如果是动态生成的,会比较麻烦,要看动态生成的相关code。
Paul Zhou [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 JSHZP 2011年5月11日 11:23
全部回复
-
我现将你的问题移到 .NET Framework 一般性问题讨论区 以便得到更好的支持,谢谢.
Leo Liu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 JSHZP 2011年5月11日 11:23
-
你好,
ctlSideBar.XmlSerializers.dll这个程序集是已经存在的,还是在runtime动态生成的,看起来是因为这个程序集与你project中引用的程序集不匹配,或者是这个程序集依赖项不匹配。
如果是固有的程序集,可以移除程序集,重新add后rebuild一下,如若还是不行,需要检查该程序集的platform,看到你设置成了x86了,另外还需检查一下target的.NET Framework版本,是否是主程序支持的,比如主程序是.NET Framework V2.0或者3.5的,加载的程序是target 4.0的话是不可以的。
如果是动态生成的,会比较麻烦,要看动态生成的相关code。
Paul Zhou [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 JSHZP 2011年5月11日 11:23