admin管理员组

文章数量:1336563

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:


To install missing framework, download:
?                                                           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 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

Share Improve this question edited Nov 20, 2024 at 7:07 Harsh Kumar asked Nov 20, 2024 at 6:59 Harsh KumarHarsh Kumar 3762 silver badges12 bronze badges 5
  • 1 What version of dotnet-aspnet-codegenerator do you have installed? Try installing the 9th one with dotnet tool install --global dotnet-aspnet-codegenerator --version 9.0.0. – Guru Stron Commented Nov 20, 2024 at 7:33
  • 1 Randomly installing SDKs solves nothing. There's absolutely nothing wrong with .NET 8. threw some weird error. what error? Fix that instead. As for the current error, the error message is perfectly clear - you tried to use a .NET 8 tool without .NET 8 installed – Panagiotis Kanavos Commented Nov 20, 2024 at 7:34
  • When you install the latest generator version you'll most likely get the original error again. Whatever the original problem was it wasn't in .NET 8 – Panagiotis Kanavos Commented Nov 20, 2024 at 7:34
  • and chatgpt randomly generated text is less helpful than random SDK installations. If you get an error because there's no project to scaffold, or you're running the tool in the wrong folder, reinstallation won't fix anything – Panagiotis Kanavos Commented Nov 20, 2024 at 7:37
  • I get the same error, despite installing version 9.0.0 of dotnet-aspnet-codegenerator – Kacper Wyczawski Commented Feb 19 at 17:14
Add a comment  | 

3 Answers 3

Reset to default 0

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

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

I had to install dotnet 8 alongside my version 9 and make sure it was added to PATH.

本文标签: aspnetcodegenerator not supported for NET 90Stack Overflow