I am trying to install .NET 6 and 7 on my Mac (M1 chip) and after trying several approaches, I am going nowhere.
Option-1: Using brew
- Installed .NET 7. Here, I see successful installation under
/opt/homebrew/Cellar/dotnet/7.0.100
which is good. - Installed .NET 6. This is installed under
/opt/homebrew/Cellar/dotnet@6/6.0.114
When I run dotnet --list-runtimes
then I only see 7.0.0
.
Microsoft.AspNetCore.App 7.0.0 [/opt/homebrew/Cellar/dotnet/7.0.100/libexec/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.0 [/opt/homebrew/Cellar/dotnet/7.0.100/libexec/shared/Microsoft.NETCore.App]
I get that brew command creates dotnet@6
.
How can I have this with .NET 7
so that I don't run into You must install or update .NET to run this application.
error?
Option-2: Using Install-scripts
.
- I installed dotnet-install scripts from here (chose
.NET Runtime 6.0.20
). - Then ran following commands
chmod +x dotnet-install.sh
sudo ./dotnet-install.sh --runtime dotnet --version 6.0.20 --install-dir /opt/homebrew/Cellar/dotnet
sudo ./dotnet-install.sh --runtime aspnetcore --version 6.0.20 --install-dir /opt/homebrew/Cellar/dotnet
- When I ran
dotnet --list-runtimes
again, then it just showed7.0.0
. Here, I was expecting the above command to create a new folder, like6.0.20
similar to7.0.100
but it didn't. All files were directly installed underdotnet
folder. - Reference, https://danielhilton.medium.com/how-to-install-multiple-asp-net-core-runtimes-in-macos-717e8d0176ea
Option-3-Using Installers and SDK and Runtime which installs successfully, but I end up seeing 7.0.0
only.
My end goal is to fix the following error: How to fix this?
You must install or update .NET to run this application.
App: /Users/USERNAME/.dotnet/tools/.store/dotnet-ef/6.0.14/dotnet-ef/6.0.14/tools/net6.0/any/tools/netcoreapp2.0/any/ef.dll
Architecture: arm64
Framework: 'Microsoft.NETCore.App', version '6.0.0' (arm64)
.NET location: /opt/homebrew/Cellar/dotnet/7.0.100/libexec/
The following frameworks were found:
7.0.0 at [/opt/homebrew/Cellar/dotnet/7.0.100/libexec/shared/Microsoft.NETCore.App]
Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=6.0.0&arch=arm64&rid=osx.13-arm64
Additional Info: