Today, I am going to cover bit explanation for project.json file.
This is the one of the most existing change has made by Microsoft in Asp.Net 5. Which is an introduction of project.json file.
Project.json file manage many configuration sections like dependencies, commands, dynamic frameworks, exclude, publishExclude and scripts executing at different events.
Let's check step by step by step.
Step 1. Open visual studio 2015 and create a new project from File -> New Project -> Select ASP.NET web application.
Step 2. Select Asp.Net 5 template and choose the web application.
Once solution is ready to work but you will try to found web.config file. but "Web.Config" gone now and that is the easiest way to manage configuration on asp.net 5
Step 3. You will check project.json file on root level and double click on it and see what inside it.
You will find the file is divided in various section like dependencies, commands etc..
In dependencies section you can add project dependency and Nuget packages. That is easy to configure the dependencies.
- Commands
This section allows you to define commands for your project, which later on you can execute using dnx
- Frameworks
Asp.Net support mulitple frameworks and which will use dynamic framework based on housting.
- Exclude
This section indicate to that folder which will be not part of publicing website. It means those folder will be exculded from publising website.
- PublishExclude
This is very similar to exclude but publish exculde support folder and files both.
- Scripts
Script tag use for specific build automation script can excute before publishing the website. There is ain mention under"prepublish" and "postpublish".
This is the one of the most existing change has made by Microsoft in Asp.Net 5. Which is an introduction of project.json file.
Project.json file manage many configuration sections like dependencies, commands, dynamic frameworks, exclude, publishExclude and scripts executing at different events.
Let's check step by step by step.
Step 1. Open visual studio 2015 and create a new project from File -> New Project -> Select ASP.NET web application.
Step 2. Select Asp.Net 5 template and choose the web application.
Once solution is ready to work but you will try to found web.config file. but "Web.Config" gone now and that is the easiest way to manage configuration on asp.net 5
Step 3. You will check project.json file on root level and double click on it and see what inside it.
You will find the file is divided in various section like dependencies, commands etc..
{ "userSecretsId": "aspnet5-EF7Migration-fceaa439-1593-4551-962c-4521fb028fd7", "version": "1.0.0-*", "compilationOptions": { "emitEntryPoint": true }, "dependencies": { "EntityFramework.Commands": "7.0.0-rc1-final", "EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final", "Microsoft.ApplicationInsights.AspNet": "1.0.0-rc1", "Microsoft.AspNet.Authentication.Cookies": "1.0.0-rc1-final", "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-rc1-final", "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final", "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final", "Microsoft.AspNet.Mvc": "6.0.0-rc1-final", "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final", "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final", "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final", "Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final", "Microsoft.Extensions.CodeGenerators.Mvc": "1.0.0-rc1-final", "Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final", "Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final", "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc1-final", "Microsoft.Extensions.Logging": "1.0.0-rc1-final", "Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final", "Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final", "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc1-final" }, "commands": { "web": "Microsoft.AspNet.Server.Kestrel", "ef": "EntityFramework.Commands" }, "frameworks": { "dnx451": { }, "dnxcore50": { } }, "exclude": [ "wwwroot", "node_modules" ], "publishExclude": [ "**.user", "**.vspscc" ], "scripts": { "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ] } }- Dependencies
In dependencies section you can add project dependency and Nuget packages. That is easy to configure the dependencies.
- Commands
This section allows you to define commands for your project, which later on you can execute using dnx
- Frameworks
Asp.Net support mulitple frameworks and which will use dynamic framework based on housting.
- Exclude
This section indicate to that folder which will be not part of publicing website. It means those folder will be exculded from publising website.
- PublishExclude
This is very similar to exclude but publish exculde support folder and files both.
- Scripts
Script tag use for specific build automation script can excute before publishing the website. There is ain mention under"prepublish" and "postpublish".
0 comments:
Post a Comment