To create a new ASP.NET MVC project, perform the following steps:
wwwroot
folder inside the project and navigate to Add | New Folder. Create the following two folders:css
js
styles.css
file from the Bootstrap 4 Admin Dashboard template css
folder to the css
folder inside the wwwroot
folder in the project.scripts.js
file located in the Bootstrap 4 Admin Dashboard template's js
folder to the js
folder in the project's wwwroot
folder.Controllers
and Views
.project.json
file and add the following to the list of dependencies and tools:"dependencies": { "Microsoft.NETCore.App": { "version": "1.0.0", "type": "platform" }, "Microsoft.AspNetCore.Diagnostics": "1.0.0", "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", "Microsoft.Extensions.Logging.Console": "1.0.0", "Microsoft.AspNetCore.Mvc": "1.0.0", "Microsoft.AspNetCore.StaticFiles": "1.0.0", "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0", "Microsoft.AspNetCore.Razor.Tools": { "version": "1.0.0-preview2-final", "type": "build" }, "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.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final", "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { "version": "1.0.0-preview2-final", "imports": [ "portable-net45+win8" ] }}
project.json
files, Visual Studio will automatically add all the required dependencies to the project.Startup.cs
file in the project root and change the ConfigureService
method to enable MVC, as illustrated here:public void ConfigureServices(IServiceCollection services) { services.AddMvc(); }
Configure
method, as shown in the following code:public void Configure(IApplicationBuilder app) { app.UseIISPlatformHandler(); app.UseStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); }
18.191.235.62