The project works locally, but crashes on Azure

I just posted my project on Azure and suddenly I got the following error:

Failed to load file or assembly "System.Web.Cors, Version = 5.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35" or one of its dependencies. The located assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I have not updated or installed any nuget packages since the last post. In addition, I just checked the .dkk file and copied local so that it is true.

What could be the problem? I have not changed anything.

In sitenode, my project works fine locally.

+5
source share
1 answer

This, of course, leads to the fact that your version of the DLL is different from the others. There is no dll in this environment.

A few steps required to verify:

  • Cors DLL should be in your BIN [On Azure] directory

  • If there, then the version of the DLL deployed on the server and your local one should both be the same. [You can check the properties]

  • If your version of the Cors DLL is higher on the Azure server, compare it with the local one, you can
<dependentAssembly> <assemblyIdentity name="System.Web.Cors" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.0.0.1" /> </dependentAssembly> 

Your new version may be your version of the DLL, available in the BIN directory.

+4
source

Source: https://habr.com/ru/post/1209034/


All Articles