question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

3.1.401 : dotnet-aspnet-codegenerator: command not found

See original GitHub issue

Opened by @drammons at https://github.com/dotnet/AspNetCore.Docs/issues/19785

Got to the generated scaffolding step. Ensured dotnet-aspnet-codegenerator was definitely installed. Tried both variants of the command mentioned in other issues (with and without the hyphen)

$ dotnet --version
3.1.401

$dotnet tool update -g Dotnet-aspnet-codegenerator
Tool 'dotnet-aspnet-codegenerator' was reinstalled with the latest stable version (version '3.1.4').

$dotnet-aspnet-codegenerator controller -name TodoItemsController -async -api -m TodoItem -dc TodoContext -outDir Controllers
dotnet-aspnet-codegenerator: command not found

$ dotnet aspnet-codegenerator controller -name TodoItemsController -async -api -m TodoItem -dc TodoContext -outDir Controllers
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET Core program, but dotnet-aspnet-codegenerator does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

17reactions
iamnicojcommented, Apr 4, 2021

I think there is an extra unnecessary ‘-’ on the guidance. It worked for me just using dotnet aspnet-codegenerator

10reactions
glenn2223commented, Sep 11, 2020

Is the tool installed at the below location. Reference

OS Path
Linux/macOS $HOME/.dotnet/tools
Windows %USERPROFILE%.dotnet\tools

I noticed you installed it with a capital D have you tried

Dotnet-aspnet-codegenerator controller -name TodoItemsController -async -api -m TodoItem -dc TodoContext -outDir Controllers

Also has uninstalling and reinstalling worked

dotnet tool uninstall --global dotnet-aspnet-codegenerator
dotnet tool install --global dotnet-aspnet-codegenerator

Read more comments on GitHub >

github_iconTop Results From Across the Web

ASP.NET Core CRUD tool: command not found but ...
Yes I have run: dotnet aspnet-codegenerator razorpage -m Movie -dc RazorPagesMovieContext -udl -outDir Pages\Movies --referenceScriptLibraries ...
Read more >
dotnet aspnet-codegenerator command
Specifies the path of the project file to run (folder name or full path). If not specified, it defaults to the current directory....
Read more >
Troubleshoot .NET tool usage issues
Could not execute because the specified command or file was not found. Possible reasons for this include: * You misspelled a built-in dotnet ......
Read more >
No executables found matching command 'dotnet-aspnet ...
Under System variables find and select the Path variable, then click Edit . Check if the path to dotnet-aspnet-codegenerator.exe is there and if...
Read more >
Visual Studio 2019 unable to locate .Net Core SDK
Step 1) First run dotnet --list-sdks from the command line (as in Grzegorz Smulko's answer). Take note of the greatest version number.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found