A file matching the name ApiControllerWithContext.cshtml was not found within any of the folders:
See original GitHub issueNote: If filing an issue related to using Scaffolding within Microsoft Visual Studio, please file an issue on the Microsoft Developer Community instead of here. This can be accomplished from Visual Studio by clicking on Help > Send Feedback, and choosing the appropriate action.
Steps to reproduce:
dotnet aspnet-codegenerator controller -name TodoItemsController -async -api -m TodoItem -dc TodoContext -outDir Controllers
Expected behavior:
Should run without any errors
Actual behavior:
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
Additional information about the project being scaffolded, such as:
I am using vs code in Ubuntu 18.04
Target framework(s):
dotnet core 3.1
Package version of Microsoft.AspNetCore.App or Microsoft.AspNetCore.All (if applicable):
3.1
Package version of Microsoft.VisualStudio.Web.CodeGeneration.Design - this may be added to your project by scaffolding:
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:38 (4 by maintainers)
Top Results From Across the Web
Asp.NET Core, unable to find View of cshtml when published
The issue is that when the website is published the service is unable to find path to Views/Emails/EmailRiepilogo.cshtml as on publish the View ......
Read more >Microsoft.VisualStudio.Web.CodeGenerators.Mvc.dll
Microsoft.VisualStudio.Web.CodeGenerators.Mvc.dll. This report is generated from a file or URL submitted to this webservice on January 17th 2019 14:27:56 ...
Read more >Telerik Kendo UI Master Detail Grids with full edits using ...
Create a new folder structure at the solution root. Templates\ControllerGenerator. Copy “ApiControllerWithContext.cshtml” from “C:\Program Files ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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/
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