Could not load file or assembly 'System.IdentityModel.Tokens.Jwt, Version=4.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 somehow returned to DLL hell.
I have an asp.net MVC app that I want to deploy via our CI:
- TeamCity (
2017.1.3
) with the Octopusplugin (TeamCity Plugin) - Octopus deploying to azure website app
I've gotten this same pipeline to work for other web apps, but for this one MVC app that utilizes System.IdentityModel.Tokens.Jwt
, version 4.0.4.403061554
.
I run the app locally, and the FileAssembly version referenced is 4.0.4.403061554
as expected. However, when team city builds the nuget package, and I download and extract it, the System.IdentityModel.Tokens.Jwt
file assembly version is set to 5.1.4.216
which is not what I am expecting.
I've drilled through all of my packages deplendencies, none are referencing this version of the dll.
I have searched through all of my files for any refernece of 5.1.4, nothing exists.
I have also checked the feature to Disable looking up packages from local machine cache
when refreshing packages in TeamCity.
There is not a straight answer here, however a couple thoughts which could hopefully help in the right direction.
Maybe there is a lower level dependency to this package in any other project or nuget package, which gets built together and as a result the latest version gets into build directory? Just noted that the 5.1.4 is the latest version of
System.IdentityModel.Tokens.Jwt
.I presume you employ
BindingRedirect
to version 4. Have there been braking changes? Could you not switch to using the latest version?Have you looked in the build folder of the build server? Maybe you could narrow down the project/folder with the version 5.1.4?