Could not load file or assembly 'sapnco' or one of its dependencies. An attempt was made to load a program with an incorrect format

删除回忆录丶 提交于 2020-02-22 04:05:47

问题


I have got this error while I am using SAP .NET Connector 3.0 x64. I couldn't find any solution at stackoverflow, so I d like to share here for others who stuck at same problem like me.


回答1:


Run > Regedit

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\1X.0\WebProjects   

Change Use64BitIISExpress from 0 to 1 Restart Visual Studio and IISExpress.




回答2:


In VS 2017 I was able to resolve this by setting the Bitness to "x64" for IIS Express in the server section under the project web properties. I imagine this is similar to making the Use64BitIISExpress Regedit change in one of the other answers.




回答3:


You Can try browsing/configured your service through IIS, and set appPool .Net 4.0. I hope this solve the sapnco dll issue.




回答4:


I had similar problem with x86

I set the Platform Target from "any" to "x86", in Project/Properties and fixed the problem.




回答5:


I had similar problem with VS 2017 and AnyCPU project option.

To fix the problem I disable Prefer 32-bit checkbox in project build properties.



来源:https://stackoverflow.com/questions/25887269/could-not-load-file-or-assembly-sapnco-or-one-of-its-dependencies-an-attempt

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!