.NET 6 installer fails builds of Azure Function projects on macOS
See original GitHub issueHi,
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.
- On a macOS machine, using .NET 5 + .NET 3.1 - building an Azure Functions project works fine.
- Downloading and installing the .NET 6 Preview installer( via https://download.visualstudio.microsoft.com/download/pr/9e02abfd-b421-4c43-8541-482f037ed19c/f61bd4f35c444710016db8b5a7206a97/dotnet-sdk-6.0.100-preview.7.21379.14-osx-x64.pkg ), and building using the .NET 6 preview 7 SDK I get the error :
Metadata generation failed. Exit code: '137' Error: 'Failed to initialize CoreCLR, HRESULT: 0x80004005
:
/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:
- Created 2 years ago
- Comments:42 (16 by maintainers)
Top GitHub Comments
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.
@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@johnkors @badgerowluke – just to confirm, you’re not on an M1 machine, right?