Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Project works locally but crashes on Azure

I just published my project to Azure and all the sudden I get the following error:

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

I have not updated/installed any nuget packages since the last publish. Furthermore I just checked the .dkk file and copy local is set to true.

What could be the issue here? I haven't changed anything.

On a sitenode my project works fine locally.

like image 706
Rune Avatar asked Sep 29 '22 05:09

Rune


1 Answers

This is surely coming cause of your DLL version is different OR DLL is missing on that environment.

Few steps you require to check:

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

  • If it's there then Version of DLL deployed on server and your local both should be same. [You can check in properties]

  • If your version of Cors DLL higher on Azure server, compare to local one then 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 could be your DLL version which are availbale into the BIN directory.

like image 131
Abhishek Gupta Avatar answered Oct 10 '22 07:10

Abhishek Gupta