Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating Microsoft.NET.Sdk.Functions to 3.0.4+ raise an exception #24

Closed
Invvard opened this issue Sep 22, 2020 · 5 comments · Fixed by #25 or #26
Closed

Updating Microsoft.NET.Sdk.Functions to 3.0.4+ raise an exception #24

Invvard opened this issue Sep 22, 2020 · 5 comments · Fixed by #25 or #26

Comments

@Invvard
Copy link
Contributor

Invvard commented Sep 22, 2020

Hi guys,

First of all : a big thank you for your work and this Sample ! I think this is the one and only repo with a functioning example.
And it works out of the box which is rare enough to be mentioned.

I tried to apply this to a new project of mine but it did not work. I spent several hours trying to pin point the issue : it is the Microsoft.NET.Sdk.Functions package update above 3.0.4 (included).

With the current latest version (3.0.9), here is the error I get:

Executed 'HelloFunction' (Failed, Id=c5d9d096-e4bc-4144-bf3f-2040f2ab69d8, Duration=267ms)
System.Private.CoreLib: Exception has been thrown by the target of an invocation. OidcApiAuthorization: Could not load file or assembly 'Microsoft.IdentityModel.Protocols, Version=6.7.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
An unhandled host error has occurred.
System.Private.CoreLib: Exception has been thrown by the target of an invocation. OidcApiAuthorization: Could not load file or assembly 'Microsoft.IdentityModel.Protocols, Version=6.7.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

At first, I thought it was the Microsoft.IdentityModel.Protocols NuGet package behaving but after updating package one by one,I found it is indeed Microsoft.NET.Sdk.Functions.

Step to reproduce :

  1. Pull master branch,
  2. Configure Auth0 audience and endpoint,
  3. Test and validate everything works as expected,
  4. Update NuGet packages,
  5. Run the Azure Functions again.
  6. The Azure Function Emulator Console shows the error above.

If I can be of any help, let me know.

@Invvard
Copy link
Contributor Author

Invvard commented Sep 22, 2020

After a good night sleep and a few new Google search, I found the solution.
I'm going to create a PR with it.

@Invvard
Copy link
Contributor Author

Invvard commented Sep 22, 2020

Pull request is available here

@bryanknox
Copy link
Owner

Thank you so much for your work on this @Invvard. I really appreciated the effort you put in on bringing it up to date.

@bryanknox
Copy link
Owner

I updated the unit test to match the typo-fix.

@Invvard
Copy link
Contributor Author

Invvard commented Sep 27, 2020

I'm the one that is thanking you :)
You saved me a nice amount of time, so it is a small give back.

If I may : have you thought about making this solution into a NuGet package ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants