question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.NET 6 installer fails builds of Azure Function projects on macOS

See original GitHub issue

Hi,

this is an odd case first registered here: https://github.com/Azure/azure-webjobs-sdk/issues/2755.

It only happens on macOS on a dev machine, and is not possible to reproduce using the GitHub Actions macOS-11 host.

/Users/johnkors/.nuget/packages/microsoft.azure.webjobs.script.extensionsmetadatagenerator/1.2.0/build/Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(37,5): warning : Failed to initialize CoreCLR, HRESULT: 0x80004005 [/Users/johnkors/kode/blank/fplbot-org/fplbot/src/FplBot.Functions/FplBot.Functions.csproj] /Users/johnkors/.nuget/packages/microsoft.azure.webjobs.script.extensionsmetadatagenerator/1.2.0/build/Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(37,5): error : Metadata generation failed. Exit code: ‘137’ Error: ‘Failed to initialize CoreCLR, HRESULT: 0x80004005’ [/Users/johnkors/kode/blank/fplbot-org/fplbot/src/FplBot.Functions/FplBot.Functions.csproj]

  • Uninstalling .NET 6 previews and re-building with .NET 5 SDK still fails with the same error, even when specifying to build with the .NET 5 SDK in a global.json

The only fix I’ve found, is to first uninstall .NET 6 completely, then re-run the .NET 5 installer. So something is off in the .NET 6 installer package, as I suspect as mentioned in the linked issue. That, or somehow uninstalling .NET 6 is incomplete when following the recommended guidelines.

My dev machine is running macOS 11.15 BigSur (x64)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:42 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
ericstjcommented, Nov 29, 2021

We found a reliable repro using the scripts (and a workaround) but it’s possible pkg installation would hit the same issue. I believe this bug would explain the situation you observed. If anyone is in this state, then running the above workaround should confirm that the problem is not with the binary/host itself, but with the operating system / file system. We did also file an issue with Apple on this, but I don’t have a ticket to link.

1reaction
ericstjcommented, Nov 12, 2021

@vitek-karas I did confirm your theory that old installers will overwrite the host. https://github.com/dotnet/runtime/issues/61526

That could explain why reinstalling 5.0 is fixing this. Not sure what Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets might be observing in the dotnet shared host though. As @vitek-karas mentioned

This should have very little effect on functionality

@johnkors @badgerowluke – just to confirm, you’re not on an M1 machine, right?

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
Cannot debug net6.0-macos Apps - Developer Community
This is a regression. I can no longer debug net6.0-macos apps. It also fails for net6.0-maccatalyst apps. When I hit debug, the following ......
Read more >
Failed to initialize CoreCLR hresult: 0x80004005
I have created a new local project in VS Code and a new function app ... not exist: /Users/name/NewAzureFunctions/bin/Release/net6.0/publish.
Read more >
Tutorial: Azure Functions & Visual Studio for Mac
A detailed walkthrough of working with Azure Functions in Visual Studio for Mac.
Read more >
Azure function build pipeline fails and getting error i.e. ...
I have deployed the my changes to azure function and deployed for the same but while building pipeline it fails in build solution...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found