-
Notifications
You must be signed in to change notification settings - Fork 469
Closed
Labels
bot: do not closePrevents bot automation from closing issuesPrevents bot automation from closing issues
Description
A newly-created Azure Functions project fails to load Microsoft.IdentityModel.Tokens even when the .csproj file contains a PackageReference to the Microsoft.IdentityModel.Tokens NuGet package.
Investigative information
N/A, this issue is reproducible locally.
Repro steps
- Clone my repo: https://github.com/srmagura/FunctionsAssemblyLoadingRepro
- Open the solution file in Visual Studio 2022.
- Run the project.
- Go to http://localhost:7071/api/Function1 in your web browser.
Expected behavior
There should be no errors in the debug window. The browser should display the text "Function executed."
Actual behavior
An error message is displayed in the debug window:
System.Private.CoreLib: Exception while executing function: Function1. FunctionsAssemblyLoadingRepro: Could not load file or assembly 'Microsoft.IdentityModel.Tokens, Version=6.14.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
Known workarounds
Add <_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput> to the .csproj file. This is a workaround, not a solution, because this property is internal and undocumented.
Related issues
- _FunctionsSkipCleanOutput/FunctionsSkipCleanOutput/FunctionsPreservedDependencies are solutions to a problem created by the Functions team #7601
- [ExtensionsMetadataGenerator] Improve configuration for cleaning build output #5894
- Could not load file or assembly 'System.Text.Encoding.CodePages, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. #7061
- 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 #5756
4n07h3r-0n3-3n61n33r, nguyenlamlll, ulfkri, chris-parker-bliss, andrew-flatters-bliss and 6 more
Metadata
Metadata
Assignees
Labels
bot: do not closePrevents bot automation from closing issuesPrevents bot automation from closing issues