Skip to content

Azure Functions Core Tools 4 - Microsoft.Azure.WebJobs.Extensions.Http: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' #3115

Closed

Description

Core Tools Version: 4.0.4670 Commit hash: N/A (64-bit)
Function Runtime Version: 4.7.2.18626

Creating a dot net isolated function as I upgraded from Core Tools to 4 and now I am getting this issue when attempting to start the function i.e "func host start --dotnet-isolated-debug"

[2022-08-05T02:42:18.661Z] A host error has occurred during startup operation 'c3cbacb9-304a-46e2-8de1-4fa3618620d0'.
[2022-08-05T02:42:18.662Z] Microsoft.Azure.WebJobs.Extensions.Http: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
Value cannot be null. (Parameter 'provider')

I have no updates to the packages required I have installed .Net 6 as I have also recently upgrared our .Net 5 API solutions from .Net 5 to .Net 6 and I can run and debug them fine locally, however I cannot start the isolated function for debugging as I get the above error.

Also confirmed rolling back to tools v3 and VS 2019 I can create a function and debug it locally.

Any ideas or something I can do to somehow get rid of this dependency, I know formatting is for WebApi.Client right ? So I assume it's something to do with HttpTriggers ? I don't know.

I've cleared out NuGet caches multiple times, made sure I can authenticate to feed as I can for other projects/solutions, can't work out what is causing this dependency, I actually don't see any package referencing it.

Activity

  1. JimacoMS4 commented on Aug 5, 2022

    @JimacoMS4

    +1 on this issue. I'm getting the same error running through this quickstart: https://docs.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-csharp?tabs=in-process in VS Code:

    [2022-08-04T22:36:09.418Z] A host error has occurred during startup operation '9d9439d5-3e12-40b8-b6fc-08727ce75b49'.
    [2022-08-04T22:36:09.420Z] Microsoft.Azure.WebJobs.Extensions.Http: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
    Value cannot be null. (Parameter 'provider')

    I'm on a 64-bit machine.
    func --version shows: 4.0.4670
    dotnet --info shows:
    .NET SDK (reflecting any global.json):
    Version: 6.0.302
    Commit: c857713418

    Runtime Environment:
    OS Name: Windows
    OS Version: 10.0.22000
    OS Platform: Windows
    RID: win10-x64
    Base Path: C:\Program Files\dotnet\sdk\6.0.302\

    global.json file:
    Not found

    Host:
    Version: 6.0.7
    Architecture: x64
    Commit: 0ec02c8c96

    .NET SDKs installed:
    2.1.818 [C:\Program Files\dotnet\sdk]
    3.1.421 [C:\Program Files\dotnet\sdk]
    5.0.408 [C:\Program Files\dotnet\sdk]
    5.0.409 [C:\Program Files\dotnet\sdk]
    6.0.302 [C:\Program Files\dotnet\sdk]

    .NET runtimes installed:
    Microsoft.AspNetCore.App 3.1.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 3.1.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.NETCore.App 3.1.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 3.1.27 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.WindowsDesktop.App 3.1.26 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 3.1.27 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

  2. akjal commented on Aug 7, 2022

    @akjal

    I had the same issue. I re-installed .NET 6 and then re-installed azure functions core tools. After that it started working.Hope it helps!

    Cheers

  3. Michael-D-Pine-dorsavi commented on Aug 7, 2022

    @Michael-D-Pine-dorsavi
    Author

    Hey thanks for the suggestion, I will give it a go, re-installing .Net 6 ad the azure functions core tools, our of curiosity did you install the core tools via NPM or using the MSI download ?

  4. akjal commented on Aug 8, 2022

    @akjal

    Hey thanks for the suggestion, I will give it a go, re-installing .Net 6 ad the azure functions core tools, our of curiosity did you install the core tools via NPM or using the MSI download ?

    I used MSI download.

  5. JimacoMS4 commented on Aug 8, 2022

    @JimacoMS4

    Hey thanks folks. I'll try this as well.

  6. JimacoMS4 commented on Aug 8, 2022

    @JimacoMS4

    Reinstalling (actually repairing) both .NET 6 SDK and Aure Functions Core Tools seems to have worked for me. Thanks akjal! (There was also a Windows Update this AM.)

  7. Michael-D-Pine-dorsavi commented on Aug 8, 2022

    @Michael-D-Pine-dorsavi
    Author

    Yeah thanks for the feedback, I need to remember to do these things, it's just you do something and it's like oh man what, so you try and fix it instead of just trying the old re-install but can confirm with a brand new function the re-install of both worked for me and now I can start and debug a local isolated function.

    I actually did a repair of .Net 6, I ran the installer again and just chose the repair option, PC restarted and then I uninstalled the core tools, I actually had to I had the NPM package install and also the MSI not sure if that was a bad thing to have but anyway I removed both and installed the MSI.

    Again thanks for the suggestion which also worked for me.

  8. Michael-D-Pine-dorsavi commented on Aug 8, 2022

    @Michael-D-Pine-dorsavi
    Author

    Not sure of the protocol here on the issues thread ? Should this remain open and an admin or someone of the like will close it or do I close it ?

  9. michaelpeng36 commented on Aug 9, 2022

    @michaelpeng36
    Contributor

    Closing, as a workaround was found.

  10. Joost1982 commented on Aug 21, 2022

    @Joost1982

    Had the same issue. Reinstalling .NET 6 and azure functions core tools, like akjal suggested, fixed it!

  11. Aymane1998 commented on Aug 23, 2022

    @Aymane1998

    I had the same issue. I re-installed .NET 6 and then re-installed azure functions core tools. After that it started working.Hope it helps!

    Cheers

    it didn't work for me

  12. Michael-D-Pine-dorsavi commented on Aug 23, 2022

    @Michael-D-Pine-dorsavi
    Author

    it didn't work for me

    I don't know if you had 2 versions of the core tools installed I did, I had installed them via NPM and also installed them via the MSI, maybe make sure you have un-installed in case you had both, that is what I did anyway. Maybe try a repair of .Net 6 as well ?

  13. ghost locked as resolved and limited conversation to collaborators on Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions