dotnet aspnet-codegenerator controller -name TodoItemsController -async -api -m TodoItem -dc TodoContext -outDir Controllers
Should run without any errors
A file matching the name ApiControllerWithContext.cshtml was not found within any of the folders:
at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.<BuildCommandLine>b__6_0()
at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.Execute(String[] args)
at Microsoft.VisualStudio.Web.CodeGeneration.CodeGenCommand.Execute(String[] args)
RunTime 00:00:06.25
I am using vs code in Ubuntu 18.04
dotnet core 3.1
3.1
https://github.com/dotnet/Scaffolding/issues/559#issuecomment-670198811
Ran into this yesterday.
Downgraded the tool with an dotnet tool uninstall command. The older version works correctly.
dotnet tool uninstall --global dotnet-aspnet-codegenerator
dotnet tool install --global dotnet-aspnet-codegenerator --version 3.1.0
Messing with package versions inside the project .csproj made little difference.
I was coming from the tutorials at Microsoft. This breaks the razor and MVC tutorials.
I was actually able to move past the error and complete the tutorial with the above command. That was the intended goal.
@telmotrooper Got the tool to work here?! With this:
dotnet tool uninstall --global dotnet-aspnet-codegenerator
dotnet tool install --global dotnet-aspnet-codegenerator --version 3.1.3
Obviously blowing out a couple versions may have been a bit heavy handed.
Others like @GillesWHC didn't fare so well and ended up with "No code generators".
To those of you that got that error your not alone!
@undmeer has the downgrade process for system level installs. That may be more right than blasting the tool with a global uninstall and assuming everything is ok.
@cezarlamann might have a good idea about where to start looking for the solution on linux platforms.
possible dup of #1382
I have the same issue. Has anyone found a workaround or a fix?
@GillesWHC yes, read this issue
@Rick-Anderson you mean the downgrading part? I tried that, but the tool gave me No code generators found with the name 'controller' when running 3.1.0.
same here
Same problem with 3.1.4. When I downgrate to version 3.1.0, the new problem found: No code generators found with the name 'controller'
Same problem with the same error message using the mcr.microsoft.com/dotnet/core/sdk Docker image on Windows 10 2004 with version 3.1.4.
I've tried both the 3.1.401-buster (aka latest) tag (Debian 10) and the 3.1.401-focal tag (Ubuntu 20.04). Downgrading does not solve the issue and produces a different error message for each version between 3.1.0 and 3.1.4, including the message OP posted for 3.1.4.
I was _finally_ able to work around this issue by using a custom Docker container based on Centos 8. I installed the bundled version of the dotnet 3.1 SDK (version 3.1.107) and version 3.1.1 of the aspnet-codegenerator. I've been following the Razor Pages tutorial.
Dockerfile:
FROM centos
RUN dnf install dotnet-sdk-3.1 -y
_Aside_: I'm not convinced the distro has anything to do with it, but I haven't done enough investigation to rule anything out (or in).
I had the same problem.
The version is
dotnet-sdk-3.1 is 3.1.401-1
aspnet-codegenerator is 3.1.4.
I tried
Downgraded each to 3.1.302-1 and 3.1.3.
Then it worked.
With only one downgrade, it didn't work.
My environment is Linux Mint 19.3.
Downgrading as specified by @undmeer fixed the same issue for me.
As per @undmeer closing this issue.
Hi @akchhayalok I believe that it's incorrect to close this issue as it's still present in the latest versions dotnet-sdk-3.1 version 3.1.401-1 and aspnet-codegenerator version 3.1.4.
@undmeer just suggested a version downgrade to avoid the bug in the latest versions, but the bug is still there.
The bug certainly is still here. I'd recommend against closing this issue, as that'll just spawn more duplicates.
As bug is still unresolved re-opening this issue
origin/releases/3.1 is the branch.
These guys were tinkering with nuget package pathing here.
I used this little trick
export codegen_trace=1
Ok, now I want to run the codegen:
dotnet aspnet-codegenerator controller -name TodoItemsController -async -api -m TodoItem -dc TodoContext -outDir Controllers
[Trace]: Command Line: controller -name TodoItemsController -async -api -m TodoItem -dc TodoContext -outDir Controllers
Building project ...
[Trace]: Command Line: --no-dispatch --port-number 34155 controller -name TodoItemsController -async -api -m TodoItem -dc TodoContext -outDir Controllers --dispatcher-version 3.1.4+b6993d609d406a42f2b09c27de832e70417f3bfc
See that b6993d609d406a42f2b09c27de832e70417f3bfc?
I wanted to make sure I was using the right stuff.
andy@andyLinuxbox:~/dotnet/Scaffolding/Scaffolding$ git show b6993d609d406a42f2b09c27de832e70417f3bfc
commit b6993d609d406a42f2b09c27de832e70417f3bfc (HEAD -> release/3.1, origin/release/3.1)
Author: deepchoudhery <[email protected]>
Date: Mon Aug 3 13:06:26 2020 -0500
Revert "added policheck to azure yaml" (#1379)
This reverts commit 4894dfcc8c5a10b86c503d581fed71259e0950d0.
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index b8cd8a6f..786fecbd 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -17,10 +17,6 @@ variables:
value: true
- name: _DotNetArtifactsCategory
value: .NETCore
I changed the branch source and ran the build.sh. It actually fails with another error no permission to execute another! build.sh in a subdirectory.
cd eng/common
chmod 0755 build.sh
Go back to the main directory and build.
./build.sh
...
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:16.28
andy@andyLinuxbox:~/dotnet/Scaffolding/Scaffolding$ git branch
dev/decho/3.1.4DependencyFix
master
* release/3.1
So, now I want to mess with the local executable... that might've worked but they have a nice cmd script there with a brand new nuget package... just no linux script that does the same stuff.
set VERSION=3.1.4
set DEFAULT_NUPKG_PATH=%userprofile%/.nuget/packages
set SRC_DIR=%cd%
set NUPKG=artifacts/packages/Debug/Shipping/
call taskkill /f /im dotnet.exe
call git clean -xdf
call build.cmd
call dotnet tool uninstall -g dotnet-aspnet-codegenerator
call cd %DEFAULT_NUPKG_PATH%
call rd /Q /S microsoft.visualstudio.web.codegeneration
call rd /Q /S microsoft.visualstudio.web.codegeneration.contracts
call rd /Q /S microsoft.visualstudio.web.codegeneration.core
call rd /Q /S microsoft.visualstudio.web.codegeneration.design
call rd /Q /S microsoft.visualstudio.web.codegeneration.entityframeworkcore
call rd /Q /S microsoft.visualstudio.web.codegeneration.templating
call rd /Q /S microsoft.visualstudio.web.codegeneration.utils
call rd /Q /S microsoft.visualstudio.web.codegenerators.mvc
call cd %SRC_DIR%/%NUPKG%
call dotnet tool install -g dotnet-aspnet-codegenerator --add-source %SRC_DIR%\%NUPKG% --version %VERSION%
call cd %SRC_DIR%
So what are we to doing here? They set up some variables and then kill anything with dotnet.exe, clean the source, build it, remove the tool globally, wipe microsoft.visualstudio.web.codegeneration* from the local ~/.nuget/packages/, finally we run the dotnet tool install command with the new nuget package we just created.
Maybe @deepchoudhery or others can help with a couple questions:
We just blasted the codegeneration.design from nuget? If I self build what needs to be done to fix it.
dotnet tool install -g dotnet-aspnet-codegenerator --add-source artifacts\packages\Debug\shipping\ --version 3.1.4
What about re-adding the other packages?
dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design --add-source artifacts\packages\Debug\shipping\ --version 3.1.4
I could add a break point to the source at least now.
I had the same problem.
The version is
dotnet-sdk-3.1 is 3.1.401-1
aspnet-codegenerator is 3.1.4.I tried
Downgraded each to 3.1.302-1 and 3.1.3.
Then it worked.
With only one downgrade, it didn't work.My environment is Linux Mint 19.3.
can you share step for downgrade?
I had the same problem.
The version is
dotnet-sdk-3.1 is 3.1.401-1
aspnet-codegenerator is 3.1.4.
I tried
Downgraded each to 3.1.302-1 and 3.1.3.
Then it worked.
With only one downgrade, it didn't work.
My environment is Linux Mint 19.3.can you share step for downgrade?
sudo apt-get remove dotnet-sdk-3.1 --purge
sudo apt-get install dotnet-sdk-3.1=3.1.302-1
sudo apt-mark hold dotnet-sdk-3.1
dotnet tool uninstall -g dotnet-aspnet-codegenerator
dotnet tool install -g dotnet-aspnet-codegenerator --version 3.1.3
Here are the steps I took:
sudo apt show -a dotnet-sdk-3.1 | more
sudo echo "Package: dotnet-sdk-3.1
Pin: version 3.1.302-1
Pin-Priority: 1000" > /etc/apt/preferences.d/microsoft-prod.pref
sudo apt install dotnet-sdk-3.1
dotnet tool uninstall -g dotnet-aspnet-codegenerator
dotnet tool install -g dotnet-aspnet-codegenerator --version 3.1.3
Please see the following link for PRIORITY
apt_preferences(5) Debian Manpages
dotnet-sdk doesn't seem to have any dependent packages, but considering the dependencies, I like this method.
As a new user of asp.net and trying the MS tutorial this bug was driving me crazy, glad I found the world around.
Could this issues be referenced in the tutorial?
I could solve this by doing a tricky patch.
I was working around this tutorial and ended with this. So I tried to downgrade the scaffolding engine tool to versions 1.3.0 and 1.3.3, and even installed the dotnet-ef tool. But that only led to the another known issue: No code generators found with the name 'controller.
I find out that this issue seems often happening to users which uses the .NET SDK CLI rather than those who uses the IDE, Visual Studio. So I had the hypothesis that the ApiControllerWithContext.cshtml was supposed to be a local resource into the project's source code. Such resource the IDE may satisfy, but the CLI cannnot by itself.
I googled a few and found how the template code is implemented in a BitBucket's repository, BuildScripts committed by Vince Seely in 2018. I don't know if it'sthe official template used, but it is currently working for me.
api-controller-generator-by-vince.zip
I also found another implementation of the code by @rewards510 in GitHub Gist. But this one has some "enhacements" by making use of DTOs and IRepository custom implementations for the target data model. It has functionalities out of the tutorial's actual requirements, but it may be helpful to your case.
api-controller-generator-snippet-by-rewards510.zip
What I did was copy and paste the first implementation I metioned into a file ApiControllerWithContext.cshtml at the Templates\ControllerGenerator folder from the project's root folder (as @rewards510 recommends.)
Finally I ran the tool and it worked! (And also, it compiled and let me finish the tutorial.)
I did that using the .NET SDK at version 3.1.402 installed from APT, the dotnet-aspnet-codegenerator tool at version 3.1.4 (which originally produces this issue), and the dotnet-ef at version 3.1.8 (which may be irrevelant). All that on Xubuntu LTS 20.04 with recent updates at the date.
I'm not sure if this actually solve the problem. I think the SDK or tools should be able to satisfy every template by themselves, though. However, it was a good discovering. Now I know that templates can be customized!
I had the same problem.
The version is
dotnet-sdk-3.1 is 3.1.401-1
aspnet-codegenerator is 3.1.4.
I tried
Downgraded each to 3.1.302-1 and 3.1.3.
Then it worked.
With only one downgrade, it didn't work.
My environment is Linux Mint 19.3.can you share step for downgrade?
sudo apt-get remove dotnet-sdk-3.1 --purge
sudo apt-get install dotnet-sdk-3.1=3.1.302-1
sudo apt-mark hold dotnet-sdk-3.1
dotnet tool uninstall -g dotnet-aspnet-codegenerator
dotnet tool install -g dotnet-aspnet-codegenerator --version 3.1.3
I had the same problem.
The version is
dotnet-sdk-3.1 is 3.1.401-1
aspnet-codegenerator is 3.1.4.
I tried
Downgraded each to 3.1.302-1 and 3.1.3.
Then it worked.
With only one downgrade, it didn't work.
My environment is Linux Mint 19.3.can you share step for downgrade?
sudo apt-get remove dotnet-sdk-3.1 --purge
sudo apt-get install dotnet-sdk-3.1=3.1.302-1
sudo apt-mark hold dotnet-sdk-3.1
dotnet tool uninstall -g dotnet-aspnet-codegenerator
dotnet tool install -g dotnet-aspnet-codegenerator --version 3.1.3
I had the same problem.
The version is
dotnet-sdk-3.1 is 3.1.401-1
aspnet-codegenerator is 3.1.4.
I tried
Downgraded each to 3.1.302-1 and 3.1.3.
Then it worked.
With only one downgrade, it didn't work.
My environment is Linux Mint 19.3.can you share step for downgrade?
sudo apt-get remove dotnet-sdk-3.1 --purge
sudo apt-get install dotnet-sdk-3.1=3.1.302-1
sudo apt-mark hold dotnet-sdk-3.1
dotnet tool uninstall -g dotnet-aspnet-codegenerator
dotnet tool install -g dotnet-aspnet-codegenerator --version 3.1.3
This finally worked for me. Thanks @jahnog !!
sudo apt-get remove dotnet-sdk-3.1 --purge
sudo apt-get install dotnet-sdk-3.1=3.1.302-1
sudo apt-mark hold dotnet-sdk-3.1
dotnet tool uninstall -g dotnet-aspnet-codegenerator
dotnet tool install -g dotnet-aspnet-codegenerator --version 3.1.3
Thanks @jahnog
Before:
$ dotnet --info
SDK do .NET Core (refletindo qualquer global.json):
Version: 3.1.403
Commit: 9e895200cd
Ambiente de runtime:
OS Name: linuxmint
OS Version: 20
OS Platform: Linux
RID: linux-x64
Base Path: /usr/share/dotnet/sdk/3.1.403/
Host (useful for support):
Version: 3.1.9
Commit: 774fc3d6a9
.NET Core SDKs installed:
3.1.403 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.9 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.9 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
After:
$ dotnet --info
SDK do .NET Core (refletindo qualquer global.json):
Version: 3.1.302
Commit: 41faccf259
Ambiente de runtime:
OS Name: linuxmint
OS Version: 20
OS Platform: Linux
RID: linux-x64
Base Path: /usr/share/dotnet/sdk/3.1.302/
Host (useful for support):
Version: 3.1.9
Commit: 774fc3d6a9
.NET Core SDKs installed:
3.1.302 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.9 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.9 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
My WebApi needed just the controller and no views:
$ dotnet clean
$ dotnet restore
$ dotnet aspnet-codegenerator controller --project "." -api -actions --force --controllerName FornecedorController --model MinhaAPICore.Model.Fornecedor --dataContext MinhaAPICore.Model.ApiDbContext --relativeFolderPath Controllers --controllerNamespace MinhaAPICore.Controllers
I have the same problem, do I need to downgrade my versions?
I had the same problem.
The version is
dotnet-sdk-3.1 is 3.1.401-1
aspnet-codegenerator is 3.1.4.
I tried
Downgraded each to 3.1.302-1 and 3.1.3.
Then it worked.
With only one downgrade, it didn't work.
My environment is Linux Mint 19.3.can you share step for downgrade?
sudo apt-get remove dotnet-sdk-3.1 --purge
sudo apt-get install dotnet-sdk-3.1=3.1.302-1
sudo apt-mark hold dotnet-sdk-3.1
dotnet tool uninstall -g dotnet-aspnet-codegenerator
dotnet tool install -g dotnet-aspnet-codegenerator --version 3.1.3
This worked for me, on Linux.
I had the same problem.
The version is
dotnet-sdk-3.1 is 3.1.401-1
aspnet-codegenerator is 3.1.4.
I tried
Downgraded each to 3.1.302-1 and 3.1.3.
Then it worked.
With only one downgrade, it didn't work.
My environment is Linux Mint 19.3.can you share step for downgrade?
sudo apt-get remove dotnet-sdk-3.1 --purge
sudo apt-get install dotnet-sdk-3.1=3.1.302-1
sudo apt-mark hold dotnet-sdk-3.1
dotnet tool uninstall -g dotnet-aspnet-codegenerator
dotnet tool install -g dotnet-aspnet-codegenerator --version 3.1.3I had the same problem.
The version is
dotnet-sdk-3.1 is 3.1.401-1
aspnet-codegenerator is 3.1.4.
I tried
Downgraded each to 3.1.302-1 and 3.1.3.
Then it worked.
With only one downgrade, it didn't work.
My environment is Linux Mint 19.3.can you share step for downgrade?
sudo apt-get remove dotnet-sdk-3.1 --purge
sudo apt-get install dotnet-sdk-3.1=3.1.302-1
sudo apt-mark hold dotnet-sdk-3.1
dotnet tool uninstall -g dotnet-aspnet-codegenerator
dotnet tool install -g dotnet-aspnet-codegenerator --version 3.1.3CONFIRMED TO WORK IN UBUNTU 18.04!
Also worked for me on Ubuntu 20.04, Thanks!
doesn't work with dotnet 5 in ubuntu 20.04. I tried installing dotnet 3.1 and tying the version to 3.1.3 but got some errors:
Determining projects to restore...
All projects are up-to-date for restore.
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(241,5): error NETSDK1005: Assets file '/tmp/TodoApi/obj/project.assets.json' doesn't have a target for 'net50'. Ensure that restore has run and that you have included 'net50' in the TargetFrameworks for your project. [/tmp/TodoApi/TodoApi.csproj]
Build FAILED.
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(241,5): error NETSDK1005: Assets file '/tmp/TodoApi/obj/project.assets.json' doesn't have a target for 'net50'. Ensure that restore has run and that you have included 'net50' in the TargetFrameworks for your project. [/tmp/TodoApi/TodoApi.csproj]
0 Warning(s)
1 Error(s)
doesn't work with dotnet 5 in ubuntu 20.04. I tried installing dotnet 3.1 and tying the version to 3.1.3 but got some errors:
Determining projects to restore... All projects are up-to-date for restore. /usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(241,5): error NETSDK1005: Assets file '/tmp/TodoApi/obj/project.assets.json' doesn't have a target for 'net50'. Ensure that restore has run and that you have included 'net50' in the TargetFrameworks for your project. [/tmp/TodoApi/TodoApi.csproj] Build FAILED. /usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(241,5): error NETSDK1005: Assets file '/tmp/TodoApi/obj/project.assets.json' doesn't have a target for 'net50'. Ensure that restore has run and that you have included 'net50' in the TargetFrameworks for your project. [/tmp/TodoApi/TodoApi.csproj] 0 Warning(s) 1 Error(s)
same problem
Any solution for Ubuntu 20.04 and dotnet 5?
After following the steps above, doesn't work for existing project
I had to start afresh
Solution commands
On project folder execute
mkdir Templates && mkdir Templates/ControllerGenerator && mkdir Templates/ViewGenerator
cp -r /home/$USER/.nuget/packages/microsoft.visualstudio.web.codegenerators.mvc/5.0.0/Templates/ControllerGenerator/* ./Templates/ControllerGenerator
cp -r /home/$USER/.nuget/packages/microsoft.visualstudio.web.codegenerators.mvc/5.0.0/Templates/ViewGenerator/* ./Templates/ViewGenerator/
Pay attention to the version. If updated to 5.0.1 use => .codegenerators.mvc/5.0.1/
@LeandroRezendeCoutinho
Thanks, this approach works for scaffolding views and controllers. But trying to scaffold identity, I got the following error:
/home/ProjectsMe/BasicApp/obj/Debug/net5.0/Razor/Templates/Identity/Pages/_ValidationScriptsPartial.cshtml.g.cs(36,135): error CS0103: The name 'StartTagHelperWritingScope' does not exist in the current context [/home/ProjectsMe/BasicApp/BasicApp.csproj]
/home/ProjectsMe/BasicApp/obj/Debug/net5.0/Razor/Templates/Identity/Pages/_ValidationScriptsPartial.cshtml.g.cs(36,163): error CS0103: The name 'EndTagHelperWritingScope' does not exist in the current context [/home/ProjectsMe/BasicApp/BasicApp.csproj]
/home/ProjectsMe/BasicApp/obj/Debug/net5.0/Razor/Templates/Identity/Pages/_ValidationScriptsPartial.cshtml.g.cs(49,82): error CS0103: The name 'CreateTagHelper' does not exist in the current context [/home/ProjectsMe/BasicApp/BasicApp.csproj]
/home/ben/Documents/ProjectsMe/BasicApp/obj/Debug/net5.0/Razor/Templates/Identity/Pages/_ValidationScriptsPartial.cshtml.g.cs(63,82): error CS0103: The name 'CreateTagHelper' does not exist in the current context [/home/bProjectsMe/BasicApp/BasicApp.csproj]
My environment:
.NET SDK (reflecting any global.json):
Version: 5.0.100
Commit: 5044b93829
Runtime Environment:
OS Name: ubuntu
OS Version: 20.04
OS Platform: Linux
RID: ubuntu.20.04-x64
Base Path: /usr/share/dotnet/sdk/5.0.100/
Host (useful for support):
Version: 5.0.0
Commit: cf258a14b7
.NET SDKs installed:
5.0.100 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
I can confirm that this issue exists (at least since november) and have not found working solution for it. Using Ubuntu 18.04.5 LTS, Rider EAP 2020.3. C# 9, dotnet-aspnet-codegenerator version '5.0.1', dotnet 5.0.102.
When running the utility to build crud pages for Razor Pages web app:
dotnet aspnet-codegenerator razorpage -m GpsSession -dc ApplicationDbContext -udl -outDir Pages/GpsSessions --referenceScriptLibraries
The following output is given:
Building project ...
Finding the generator 'razorpage'...
Running the generator 'razorpage'...
Attempting to figure out the EntityFramework metadata for the model and DbContext: 'GpsSession'
A file matching the name Create.cshtml was not found within any of the folders:
at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.<BuildCommandLine>b__6_0()
at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.Execute(String[] args)
at Microsoft.VisualStudio.Web.CodeGeneration.CodeGenCommand.Execute(String[] args)
When I run the same command on same repository in Win10 then everything works perfectly, crud pages are generated without any errors.
There seems to be an issue with the .nuget cache folder ( /home/username/.nuget in Linux ) if it resides in a Case Sensitive filesystem (Linux and Mac).
A way to temporarily avoid this problem seems to be mounting that folder in a Case Insensitive filesystem like it's explained in a similar Issue: https://github.com/dotnet/Scaffolding/issues/1393#issuecomment-752041418
Hey all,
@robineero @rinfz @luizhp @chadmwest @psmatsinhe @akchhayalok @en1tan @LeandroRezendeCoutinho @YukiCoco @whittingtonandy @gillescoolen @Jaredes0514 @ducbm95 @luisquintanilla @fuadnafiz98 @agnelovaz @RKiemGames @fuadnafiz98
I have a fix for this issue out with a new 3.1.5 and 5.0.2 package out.
Use dotnet tool update dotnet-aspnet-codegenerator -g --version 3.1.5/5.0.2 depending on if you are targeting .netcoreapp3.1 or net5.0. I would like it if someone could confirm the fix before I close the issue.
You will also need to update the Microsoft.VisualStudio.Web.CodeGeneration.Design package as well.
Apologize for the lengthy delay on this fix and appreciate all the feedback.
Fix seems to work. Closing.
Most helpful comment
Solution commands
On project folder execute
mkdir Templates && mkdir Templates/ControllerGenerator && mkdir Templates/ViewGeneratorcp -r /home/$USER/.nuget/packages/microsoft.visualstudio.web.codegenerators.mvc/5.0.0/Templates/ControllerGenerator/* ./Templates/ControllerGeneratorcp -r /home/$USER/.nuget/packages/microsoft.visualstudio.web.codegenerators.mvc/5.0.0/Templates/ViewGenerator/* ./Templates/ViewGenerator/