Dotnet 6.0 Azure function v4 build error - Visual Studio for Mac
See original GitHub issueBuild Error
/Users/user2/.nuget/packages/microsoft.azure.webjobs.script.extensionsmetadatagenerator/4.0.1/build/Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(37,5): error : Metadata generation failed. Exit code: '137' Error: 'Failed to initialize CoreCLR, HRESULT: 0x80004005'
Done building target "_GenerateFunctionsExtensionsMetadataPostBuild" in project "testfunc.csproj" -- FAILED.
Done building project "testfunc.csproj" -- FAILED.
Build FAILED.
/Users/user2/.nuget/packages/microsoft.azure.webjobs.script.extensionsmetadatagenerator/4.0.1/build/Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(37,5): warning : Failed to initialize CoreCLR, HRESULT: 0x80004005
/Users/user2/.nuget/packages/microsoft.azure.webjobs.script.extensionsmetadatagenerator/4.0.1/build/Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(37,5): error : Metadata generation failed. Exit code: '137' Error: 'Failed to initialize CoreCLR, HRESULT: 0x80004005'
1 Warning(s)
1 Error(s)
func version
4.0.3971
Visual Studio Enterprise 2022 for Mac Preview
Version 17.0 Preview (17.0 build 5186)
Azure function .csProj config
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.0.1" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
</Project>
Issue Analytics
- State:
- Created 2 years ago
- Comments:29
Top Results From Across the Web
Tutorial: Azure Functions & Visual Studio for Mac
A detailed walkthrough of working with Azure Functions in Visual Studio for Mac.
Read more >Azure function dotnet-isolated v4
provided via the Azure Functions Core Tools. So my error is: Microsoft.Azure.WebJobs.Script: WorkerConfig for runtime: dotnet-isolated not ...
Read more >Things I Learned #19: MacOS, Dotnet, and Azure Functions
A local, non-Docker build was occurring, so I immediately started looking at Rider to see if I had something misconfigured. The exception being ......
Read more >How to Change an Azure Function Written in .NET from In ...
The first is going to walk through creating a new Azure Function and ... Pressing F5 or clicking the Run button in Visual...
Read more >How to run Azure Functions locally on VS Code using ...
Hi there,. I've been trying to run my Azure Functions locally for a lot longer than I'd like to admit and now I...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi there, it seems a .NET 6 install breaks your Function app builds from what I can tell by reading this useful thread on it: https://issueexplorer.com/issue/dotnet/installer/11951. They’re talking about reinstalling .NET 5. I also got this issue but was able to get around it another way by doing some clean up with my SDK and Runtimes currently installed.
I’d recommend downloading the .net uninstaller from here: https://github.com/dotnet/cli-lab/releases
Once it’s running use the following command to see what you currently have installed, as a bonus it will also tell you which SDKs and runtimes are being used by Visual Studio - don’t remove these.
./dotnet-core-uninstall list
I decided on what to remove by using
dotnet sdk check
and removed anything that said there’s an update available (as long as that update was already in the list).Then use the command line to delete your sdk
--sdk
or runtime--runtime
e.g.sudo ./dotnet-core-uninstall remove 5.0.401 --sdk
Here’s what my current SDK/Runtime setup in case you want to copy mine:
hope this helps
I was able to fix it with the uninstaller, but after a visual studio (for Mac) update it broke again. Uninstalling doesn’t seem to do the trick anymore.
Reinstalling .NET 5 SDK does resolve the issue