如何获取LoaderException财产? [英] How to retrieve the LoaderException property?
本文介绍了如何获取LoaderException财产?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我得到一个错误信息,同时更新我的服务引用:
I get a error message while updating my service reference:
自定义工具警告:无法加载一个请求的类型的一种或多种。检索LoaderExceptions获取更多信息。的
我怎样才能找回LoaderException财产?
How can I retrieve the LoaderException property?
更新:我的错误,走了,当我重新导入域对象的项目。我不知道为什么这个固定的问题,但我很高兴它的工作。
Update: My errors went away when I reimported the domain object projects. I have no idea why this fixed the issue, but I'm happy it's working.
推荐答案
有没有在你的服务的code的一个问题?试试下面的代码段用于加载型或组件(在你的服务的code presumably)
Is there a problem in the code of your service? Try the snippet below for loading the type or assembly (presumably in the code of your service)
try
{
// load the assembly or type
}
catch (Exception ex)
{
if (ex is System.Reflection.ReflectionTypeLoadException)
{
var typeLoadException = ex as ReflectionTypeLoadException;
var loaderExceptions = typeLoadException.LoaderExceptions;
}
}
这篇关于如何获取LoaderException财产?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文