我將代碼部署到ST服務器時出現以下錯誤。在我的機器和開發服務器上,相同的代碼工作正常,但當我們嘗試訪問應用程序中的某個頁面時,通過ST服務器上的此錯誤。無法在服務器上加載文件或程序集錯誤
的錯誤是:
無法加載文件或程序集 'Microsoft.Owin,版本= 2.1.0.0,文化=中性公鑰= 31bf3856ad364e35' 或它的一個依賴。定位的程序集清單定義與程序集引用不匹配。 (來自HRESULT的異常:0x80131040) 描述:執行當前Web請求期間發生未處理的異常。請查看堆棧跟蹤以獲取有關該錯誤的更多信息以及源代碼的位置。
異常詳細信息:System.IO.FileLoadException:無法加載文件或程序集「Microsoft.Owin,Version = 2.1.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35」或其某個依賴項。定位的程序集清單定義與程序集引用不匹配。 (異常來自HRESULT:0x80131040)
下面是我在web.config中
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>