问题
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