![](/img/trans.png)
[英]Could not load file or assembly xxx or one of its dependencies. An attempt was made to load a program with an incorrect format.
[英]Could not load file or assembly 'sapnco' or one of its dependencies. An attempt was made to load a program with an incorrect format
我在使用 SAP .NET 连接器 3.0 x64 时遇到此错误。 我在stackoverflow上找不到任何解决方案,所以我想在这里分享给像我一样遇到同样问题的其他人。
运行 > 注册表编辑
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\1X.0\WebProjects
Use64BitIISExpress
从0
更改为1
重新启动 Visual Studio 和 IISExpress。
我对 x86 有类似的问题
我在项目/属性中将平台目标从“任何”设置为“x86”并修复了问题。
您可以尝试通过 IIS 浏览/配置您的服务,并设置 appPool .Net 4.0。 我希望这能解决 sapnco dll 问题。
我在尝试以 x64 模式连接到 SAP 时遇到此错误,我可以通过修改 App.config 文件以在启动部分中包含useLegacyV2RuntimeActivationPolicy="true"属性来解决它:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.