WcfSVCHost遇到严重错误,必须退出.这可能是由配置文件无效引起的

Leo*_*Leo 4 wcf typeloadexception wcfserviceclient

System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.Assembly.GetTypes()
   at Microsoft.Tools.SvcHost.ServiceHostHelper.LoadServiceAssembly(String svcAssemblyPath)
Run Code Online (Sandbox Code Playgroud)

我如何循环通过LoaderExceptions属性来查看发生了什么错误,因为它没有命中任何服务并在运行任何代码之前给我这个错误?

谢谢

Leo*_*Leo 9

我设法解决了这个问题.我的一个项目设置为x86,其他项目设置为Any CPU.将所有更改为任何CPU都为我解决了问题.

谢谢