question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not load file or assembly 'System.IdentityModel.Tokens.Jwt, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' after upgrading Azure Function's nuget packages to 3.0.4 or 3.0.5

See original GitHub issue

We have had an Azure Function V3 that has a reference to another C# project in a VS 2019 solution. There are some extension methods in the other C# project using System.IdentityModel.Tokens.Jwt Version=5.6.0.0 assembly to perform token validation. The Azure Function has been working fine by using those extension methods to validate token. The following code snippet shows the nuget packages:

    <PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.SignalRService" Version="1.0.2" />
    <PackageReference Include="Microsoft.Azure.EventGrid" Version="3.2.0" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventGrid" Version="2.1.0" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.3" />

We upgraded the nuget packages in the azure function according to the following list and started receiving the exception reflected the title of this ticket. What’s the solution or workaround to solve this problem?

    <PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.SignalRService" Version="1.0.2" />
    <PackageReference Include="Microsoft.Azure.EventGrid" Version="3.2.0" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventGrid" Version="2.1.0" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator" Version="1.1.4" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.4" />

For now, we had to downgrade the packages again to be able to move forward.

/cc @jeffhollan @anthonychu

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
paulbatumcommented, Mar 6, 2020

Thanks for the issue report! Go ahead and stay on 3.0.3 while we investigate.

cc @brettsam @fabiocav

4reactions
tkcecekcommented, Mar 27, 2020

Got into same problem… and worked out that it works with: Microsoft.NET.Sdk.Functions <= 1.0.31 & System.IdentityModel.Tokens.Jwt <= 6.5.0 (latest) OR Microsoft.NET.Sdk.Functions <= 3.0.5 (latest) & System.IdentityModel.Tokens.Jwt <= 5.3.0 so it’s your choice which one you need in the latest. Hope this helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found