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.126.96.36.199221351' 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?
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>
I had the same problem. I solved it by selecting 'Refresh dependencies' of the Detected Dependencies in my Install Project. I think its a bug, as the System.IdentityModel.Tokens.Jwt assembly resided in the program files target folder, and had a compliant versioning. If you're not working with VS, perhaps you could can relate this to your own development environment.
it is easy to resolve. just go to the web config and find the package in which you are getting the error. and check the version mentioned in the web.config. and compare it to the NuGet package from the reference which is already installed in the project. and make it similar in both.
In my case, I have installed the 188.8.131.52 and in web config, it shows me different. I have changed it to 184.108.40.206. and everything works fine.
User contributions licensed under CC BY-SA 3.0