VisualStudio 2017 Wep API プロジェクトで次のエラーが発生しました。
ファイルまたはアセンブリ 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' またはその依存関係の 1 つを読み込めませんでした。見つかったアセンブリのマニフェスト定義がアセンブリ参照と一致しません。(HRESULT からの例外: 0x80131040)
スタックトレース:
=== Pre-bind state information ===
LOG: DisplayName = System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = .../WebApp/
LOG: Initial PrivatePath = ...\bin
Calling assembly : System.Runtime.CompilerServices.Unsafe, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: ...\web.config
LOG: Using host configuration file: ...\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Redirect found in application configuration file: 4.0.0.0 redirected to 4.1.1.0.
LOG: Post-policy reference: System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/vs/30ca8c3f/b4b96212/System.Runtime.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/vs/30ca8c3f/b4b96212/System.Runtime/System.Runtime.DLL.
LOG: Attempting download of new URL file:///D:/DSTS/WF/WF1_0/WebApp/bin/System.Runtime.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
正確な時期は正確にはわかりませんが、Visual Studio (バージョン 15.3.2 へ) への更新後か、wep Api パッケージの更新後です。
すでに解決した他のいくつかの問題が発生しましたが、今はこのエラーで立ち往生しています。呼び出しアセンブリはSystem.Runtime.CompilerServices.Unsafe
. 私の最初の推測は、このパッケージとこれに依存するパッケージをダウングレードすることでした。私はすでにダウングレードしましたが、成功しませんでした。
また、ソリューション内のすべてのパッケージの再インストールを試み、失敗したアセンブリ参照 (いくつかありました) をチェックし、パッケージ バージョンの重複をチェックします。運がない。
更新: さらにいくつかのバンプの後、System.Runtime は参照フォルダーに存在するようになりましたが、黄色 (欠落) とマークされています。「System.Runtime」パッケージを再インストールしただけなので、ソリューションが破損しているか、パッケージがバグです。ターゲット フレームワークは 4.7 です