私はこれらのいずれかを取得しています:
Could not load file or assembly 'System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
それは続く:
=== Pre-bind state information ===
LOG: DisplayName = System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///D:/Websites/Reporting/2016-02-18.2/
LOG: Initial PrivatePath = D:\Websites\Reporting\2016-02-18.2\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Websites\Reporting\2016-02-18.2\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/reports/7733280c/d5adf208/System.Web.Mvc.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/reports/7733280c/d5adf208/System.Web.Mvc/System.Web.Mvc.DLL.
LOG: Attempting download of new URL file:///D:/Websites/Reporting/2016-02-18.2/bin/System.Web.Mvc.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
System.Web.Mvc の正しいバージョンは、D:\Websites\Reporting\2016-02-18.2\bin にあります。私は一晩中このプロジェクトと戦ってきましたが、この問題を乗り越えることができないようです. 価値があるのは、web.config にバインディング リダイレクトもあるということです。
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
私は通常、dll地獄タイプのものはかなり得意ですが、これは困惑しています.binディレクトリにあるファイルが見つからず、探しているバージョンである為に。
ここからどこへ行けばいいですか?
編集:開発では問題なく動作し、開発マシンのどこかにプロジェクトをデプロイすると問題なく動作することを指摘する必要があります。しかし、ステージング サーバーにデプロイすると、これが発生します。何が違うのかわからない。最初に、TFS ビルドが間違った dll を取得するという問題がありました (copy local = true を持っていて、ヒント パスがあったとしても、まだ間違ったバージョンを取得しており、これを防ぐために古い nuget パッケージ フォルダーを削除する必要がありました)。 . このエラーは何度も発生していますが、これは初めてのことであり、ファイルをチェックしたとき (およびダブル、トリプル、およびクアドラプルでチェックしたとき) は実際には正しいバージョンでした。