The located assembly's manifest definition does not match the assembly reference.

Could not load file or assembly 'System.Web.Http.WebHost, 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)


查看dll 版本,查看相關聯的dll 的版本,確認是否版本號順序是否正確。經查,Http.WebHost 用的是 5.0.0.0 ;System.Web.Http 用是 5.2.0.0 。修改 Http.WebHost 的版本爲5.2。


自從有了 packages 與 Nuget 之後。各開發人員的電腦環境不一樣,經常將 本地的引用簽入到 tfs中 ,造成 packages.config 文件越來越大,dll 之間的引用混亂。

一時找不到對策,只好將 packages.config 永久的簽出獨佔。如果大家有更好的方法,請順便告訴我。


Visual Studio 2013中有一個新的特性。在構建應用程序時,您應該會看到警告被引用一個組裝的不同版本

How to: Enable and Disable Automatic Binding Redirection

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章