Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aspnet-codegenerator not supported for .NET 9.0

Tags:

.net

.net-core

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

like image 666
Harsh Kumar Avatar asked May 22 '26 06:05

Harsh Kumar


2 Answers

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
like image 105
Hck Avatar answered May 24 '26 19:05

Hck


It seems that there is a bug in aspnet-codegenerator. See this issue on .NET's issue tracker.

like image 20
Kacper Wyczawski Avatar answered May 24 '26 20:05

Kacper Wyczawski