![](/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.