其他分享
首页 > 其他分享> > vs2022运行WCF,System.BadImageFormatException

vs2022运行WCF,System.BadImageFormatException

作者:互联网

System.BadImageFormatException

HResult=0x80131058
Message=Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (0x80131058)
Source=<无法计算异常源>
StackTrace:
<无法计算异常堆栈跟踪>

内部异常 1:
BadImageFormatException: Cannot load a reference assembly for execution.

 

 

 

出现这个的原因,是因为目标框架的问题;

修改目标框架即可(如下图):

 

标签:load,BadImageFormatException,System,only,vs2022,0x80131058,loaded
来源: https://www.cnblogs.com/SHa-Jazy/p/15943116.html