Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dotnet tool aspnet-codegenerator looks for executable at wrong path

I'm currently following this guide in order to scaffold Identity in my existing ASP.NET Core project. When trying to run the scaffolder command with the help option, though, I'm getting this error message:

> dotnet aspnet-codegenerator --help
The application to execute does not exist: 'C:\Users\Tim\.dotnet\tools\.store\dotnet-aspnet-codegenerator\2.2.0-rtm-35687\dotnet-aspnet-codegener
ator\2.2.0-rtm-35687\tools\netcoreapp2.1\any\dotnet-aspnet-codegenerator.dll'.

I've checked the .dotnet\tools.store directory and the tool seems to be installed correctly. BUT, it is installed in a 2.2.0 directory instead of the 2.2.0-rtm-35687 directory, which dotnet tool is looking in.

I've tried uninstalling the tool again and installing it again; updating .NET Core (now at v2.2.100), but it didn't help. Is there a way to configure where dotnet tool will look for globally installed tools?

like image 599
tBureck Avatar asked Mar 05 '23 22:03

tBureck


1 Answers

Just change the folder name from "2.2.0" to "2.2.0-rtm-35687" in both the places inside the c:\users\.dotnet\tools.store\dotnet-aspnet-codegenerator folder and c:\users\.dotnet\tools.store\dotnet-aspnet-codegenerator\2.2.0-rtm-35687\dotnet-aspnet-codegenerator folder

Now try to run the command. It works for me.

P.S: I am not much sure how this is going to affect other areas so far not detected any

like image 73
Manoj Roy Avatar answered Mar 08 '23 00:03

Manoj Roy