Traditionally there used to be scaffolding in Visual Studio to speed up adding controllers, areas, views, etc. After I installed ASP.NET Core, I noticed that all of these are gone, and this terrible (especially when you want to add a new area, it will be a terrible pain in the neck to manually do the job).
Is there any possible way to bring them back? Why would Microsoft team make such terrible decision?
Is there any possible way to bring them back?
You need to add the necessary packages:
Microsoft.VisualStudio.Web.CodeGeneration.Tools
Microsoft.VisualStudio.Web.CodeGenerators.Mvc
Here is an example project.json file:
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.1",
"type": "platform"
},
"Microsoft.AspNetCore.Mvc": "1.0.1",
"Microsoft.AspNetCore.Hosting": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
"version": "1.0.0-preview2-final",
"type": "build"
}
},
"tools": {
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview2-final",
"imports": [
"portable-net45+win8"
]
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
}
}
After adding those packages, you will have access to the scaffolding.
For reference, the above screenshot is from Visual Studio 2015 Update 3 with these relevant extensions:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With