How to retrieve the LoaderException property?

前端 未结 4 1755
遥遥无期
遥遥无期 2020-11-28 08:21

I get a error message while updating my service reference:

Custom tool warning: Unable to load one or more of the requested types. Retrieve the LoaderExceptions

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-28 08:51

    try
    {
      // load the assembly or type
    }
    catch (Exception ex)
    {
      if (ex is System.Reflection.ReflectionTypeLoadException)
      {
        var typeLoadException = ex as ReflectionTypeLoadException;
        var loaderExceptions  = typeLoadException.LoaderExceptions;
      }
    }

提交回复
热议问题