Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load file or assembly 'System.IdentityModel.Tokens.Jwt after deploying on Azure

my web app is working fine on localhost, but when I publish it on Azure, I get the following error:

Could not load file or assembly 'System.IdentityModel.Tokens.Jwt' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

On a localhost is working fine.

I am using 4.5 framework, and it is definned in web.config file too. I tried to reinstall it in nuget manager but I get

Package 'System.IdentityModel.Tokens.Jwt.4.0.2.206221351' already exists in project 'project1'

I also can't find this assembly in references folder. This is the first time I have expirienced this type of a problem.

What do you recommend me to do?

Regards, Sandi

like image 617
Sandi Horvat Avatar asked Apr 18 '16 07:04

Sandi Horvat


2 Answers

There is a known issue in Azure Functions host: https://github.com/Azure/azure-functions-host/issues/5894

The current workaround is to add the following to your .csproj:

<PropertyGroup>
  <_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
</PropertyGroup>
like image 72
Marek Stój Avatar answered Nov 09 '22 04:11

Marek Stój


I have figured it out. I updated System.IdentityModel.Tokens.Jwt reference via nuget package manager and it works again.

Regards!

like image 12
Sandi Horvat Avatar answered Nov 09 '22 06:11

Sandi Horvat