You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
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
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.
[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\
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 ?
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 ?
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.)
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.
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 ?
ghost locked as resolved and limited conversation to collaborators on Sep 22, 2022
Activity
JimacoMS4 commentedon Aug 5, 2022
+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 --versionshows: 4.0.4670dotnet --infoshows:.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]
akjal commentedon Aug 7, 2022
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
Michael-D-Pine-dorsavi commentedon Aug 7, 2022
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 ?
akjal commentedon Aug 8, 2022
I used MSI download.
JimacoMS4 commentedon Aug 8, 2022
Hey thanks folks. I'll try this as well.
JimacoMS4 commentedon Aug 8, 2022
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.)
Michael-D-Pine-dorsavi commentedon Aug 8, 2022
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.
Michael-D-Pine-dorsavi commentedon Aug 8, 2022
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 ?
michaelpeng36 commentedon Aug 9, 2022
Closing, as a workaround was found.
Joost1982 commentedon Aug 21, 2022
Had the same issue. Reinstalling .NET 6 and azure functions core tools, like akjal suggested, fixed it!
Aymane1998 commentedon Aug 23, 2022
it didn't work for me
Michael-D-Pine-dorsavi commentedon Aug 23, 2022
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 ?