I am trying to setup .NET in my macbook using vscode and c# devkit. I installed 8.0 first but it didn't work, threw some weird error. I tried 9.0 and it worked fine.
Then I tried aspnet-codegenerator for scaffolding and it installed fine. But on using it to generate a controller I see this error.
You must install or update .NET to run this application.
App: /Users/harshkumar/.dotnet/tools/dotnet-aspnet-codegenerator
Architecture: arm64
Framework: 'Microsoft.NETCore.App', version '8.0.0' (arm64)
.NET location: /usr/local/share/dotnet
The following frameworks were found:
9.0.0 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Learn more:
https://aka.ms/dotnet/app-launch-failed
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch? framework=Microsoft.NETCore.App&framework_version=8.0.0&arch=arm64&rid=osx-arm64&os=osx.14
Is this package not really supported in 9.0?
Edit: It is supported according to the official documentation and chatgpt but I'm still getting this error
I had the same issue after installing dotnet-aspnet-codegenerator tool for .NET 9 in Docker container. Adding an option --allow-roll-forward resolved the issue for me:
$ dotnet tool install dotnet-aspnet-codegenerator -g --allow-roll-forward
It seems that there is a bug in aspnet-codegenerator. See this issue on .NET's issue tracker.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With