Scaffolding MVC controller using EF crashes for 1.1
See original GitHub issueRepro steps:
- Create new web application using individual accounts. (I am using .Net Core Preview 2 tooling). This will generate template web app using 1.0.0 packages.
- Update all packages to 1.1.0/1.1.0-preview4-final as applicable.
- Add new class Post.cs under models. (any properties are fine).
- Right click controllers folder, Add->Controller, MVC controller with views, using Entity Framework.
- Give model class as Post.cs and Data context class as ApplicationDbContext.
Nothing happens. Doing same controller add actions in 1.0.0 adds a new controller & views in the solution.
Trying to execute the command manually (taken from output window)
dotnet aspnet-codegenerator --project "c:\users\smpatel\documents\visual studio 2015\Projects\WebApplication2\src\WebApplication2" controller --force --controllerName PostsController --model WebApplication2.Models.Post --dataContext WebApplication2.Data.ApplicationDbContext --relativeFolderPath Controllers --controllerNamespace WebApplication2.Controllers --referenceScriptLibraries --useDefaultLayout
shows aspnet-codegenerator.exe has crashed.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Visual Studio 2015 Update 1 crashes on Controller ...
This helps me: Close Visual Studio. Open administrative cmd in folder C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE ...
Read more >ASP.NET MVC Scaffolders for Controller and View FORCE ...
When using the “Add Controller…” or “Add View…” scaffolder system to add a Controller or View to an ASP .NET MVC project, it...
Read more >Scaffolding failed. Could not load information for project
I'm not able to scaffold my MVC Controller, with views, when my Library is unloaded. I've kept the reference, but it cannot find...
Read more >Error when Scaffolding Controller with views, using Entity ...
In the MVC App: Right-Click on Controllers--> Add-->New Scaffold Item-->MVC Controller with views, using EF. Select the Model Class, ...
Read more >How To Fix Common Errors Using ASP.NET MVC Scaffolding
A feature called Scaffolding creates a Controller and several ... We select the MVC 5 Controller with views, using Entity Framework option:.
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
@wstaelens ,looks like your project.json is missing the
Microsoft.VisualStudio.Web.CodeGeneration.Tools
package in thetools
section.Can you try to add the below to the tools section and see if it works?
Thanks @prafullbhosale I also had to reinstall the runtime https://www.microsoft.com/net/download/core#/current/runtime