Cannot build functions with .NET 6 on macOS
See original GitHub issueHi,
I’m getting this fatal error at build time when using the .NET 6 previews:
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]
Not sure if it’s on your end or the .NET SDK team…?
OS: macOS .NET SDK : .NET 6 Preview 7 ( 6.0.100-preview.7.21379.14 ) TFM: netcoreapp3.1 Microsoft.NET.Sdk.Functions Version 3.0.13
csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.13" />
</ItemGroup>
...
$ dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.100-preview.7.21379.14
Commit: 22d70b47bc
Runtime Environment:
OS Name: Mac OS X
OS Version: 11.5
OS Platform: Darwin
RID: osx.11.0-x64
Base Path: /usr/local/share/dotnet/sdk/6.0.100-preview.7.21379.14/
Host (useful for support):
Version: 6.0.0-preview.7.21377.19
Commit: 91ba01788d
.NET SDKs installed:
2.1.806 [/usr/local/share/dotnet/sdk]
3.1.103 [/usr/local/share/dotnet/sdk]
3.1.300 [/usr/local/share/dotnet/sdk]
5.0.100 [/usr/local/share/dotnet/sdk]
5.0.102 [/usr/local/share/dotnet/sdk]
5.0.200 [/usr/local/share/dotnet/sdk]
6.0.100-preview.5.21302.13 [/usr/local/share/dotnet/sdk]
6.0.100-preview.6.21355.2 [/usr/local/share/dotnet/sdk]
6.0.100-preview.7.21379.14 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.18 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.18 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.0-rc.2.20475.17 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-preview.5.21301.17 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-preview.6.21355.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-preview.7.21378.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.18 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-preview.7.21377.19 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:35 (4 by maintainers)
Top Results From Across the Web
Cannot debug net6.0-macos Apps - Developer Community
When I hit debug, the following error is shown in the Terminal: Possible reasons for this include: * You misspelled a built-in dotnet...
Read more >.NET 6 and M1 problems when other SDKs are present in ...
Run Rider, go to File | Settings | Build, Execution, Deployment | Toolset and Build and choose proper dotnet CLI (x64 or ARM...
Read more >Not able to run Azure functions in VS code in mac?
NOTE:- To run function locally based on the given MICROSOFT DOCUMENTATION:- Click on Ctrl - (macOS) the HttpExample function and choose ...
Read more >NETSDK1045: The current .NET SDK does not support ...
Open the Solution Properties window (ctrl-click the solution in the Solution window and select Properties), select Build - General, and uncheck ...
Read more >Azure Functions on MacOs - Visual Studio for Mac
Azure Functions is a way to create and run event-driven snippets of code –– functions –– in the cloud, without having to explicitly...
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
Yep, this is still an issue with RTM, not only previews / RCs. Updated to title of this ticket to reflect it. The only 2 possible resolutions I’ve found:
sudo rm -rf /usr/local/share/dotnet/
). Then install .NET 6 (NB! Only works 100% if you are on the latestMicrosoft.Azure.Functions.*
nugets, which it looks like you are)It’s actually not that easy to reproduce. I even tried with a macOS agent in a GitHub action with the exact same SDKs, and it built fine.
The only common denominator I found is with the sequence in which you install which SDK version matters (which I could not work out how to in a GitHub action).
The installer team looked at it here: https://github.com/dotnet/installer/issues/11951
Recommend reading what their take on it is.
I’m really unsure if this is with the functions SDK or with the installer in general, but finally just accepted it as a odd error with the 2 workarounds provided above.