- ASP.NET Core - Log In and Log Out
- ASP.NET Core - Create a User
- ASP.NET Core - User Registration
- ASP.NET Core - Identity Migrations
- Identity Configuration
- ASP.NET Core - Authorize Attribute
- ASP.NET Core - Identity Overview
- ASP.NET Core - Razor Edit Form
- ASP.NET Core - Razor Tag Helpers
- ASP.NET Core - Razor View Import
- ASP.NET Core - Razor View Start
- ASP.NET Core - Razor Layout Views
- ASP.NET Core - DBContext
- Setup Entity Framework
- ASP.NET Core - Views
- ASP.NET Core - Action Results
- ASP.NET Core - Attribute Routes
- ASP.NET Core - Routing
- ASP.NET Core - MVC Design Pattern
- ASP.NET Core - Setup MVC
- ASP.NET Core - Static Files
- ASP.NET Core - Exceptions
- ASP.NET Core - Middleware
- ASP.NET Core - Configuration
- ASP.NET Core - Project.Json
- ASP.NET Core - Project Layout
- ASP.NET Core - New Project
- ASP.NET Core - Environment Setup
- ASP.NET Core - Overview
- ASP.NET Core - Home
ASP.NET Core Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
ASP.NET Core - Project.Json
In this chapter, we will discuss the project.json file. This file is using JavaScript object notation to store configuration information and it is this file that is really the heart of a .NET apppcation. Without this file, you would not have an ASP.NET Core project. Here, we will discuss some of the most important features of this file. Let us double-cpck on the project.json file.

Currently, the default code implementation in project.json file is as follows −
{ "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" }, "tools": { "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final" }, "frameworks": { "netcoreapp1.0": { "imports": ["dotnet5.6", "portable-net45+win8"] } }, "buildOptions": { "emitEntryPoint": true, "preserveCompilationContext": true }, "runtimeOptions": { "configProperties": { "System.GC.Server": true } }, "pubpshOptions": { "include": ["wwwroot", "web.config" ] }, "scripts": { "postpubpsh": [ "dotnet pubpsh-iis --pubpsh-folder %pubpsh:OutputPath% --framework %pubpsh:FullTargetFramework%" ] } }
As we see, we have version information at the top of this file. This is the version number your apppcation will use when you build it.
The version is 1.0.0, but the most important part of this file is the dependencies.
If your apppcation is going to do any useful work, then you will need pbraries and frameworks to do that work, such storing and retrieving data to/from a database or render comppcated HTML.
With this version of ASP.NET Core, the dependencies are all managed via the NuGet package manager.
NuGet has been around the .NET space for a few years, but now the primary way to manage all your dependencies is by using pbraries and frameworks that are wrapped as NuGet packages.
All of the top-level NuGet packages your apppcation needs will be stored in this project.json file.
"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
You can see we have some dependencies in this file and the exact dependencies will probably change by the final release of ASP.NET. When you want to add a new dependency, say pke the ASP.NET MVC framework, you easily type into this project.json file, and you will also get some IntelpSense help including not just the package name but also the version numbers as shown in the following screenshot.

You can also use the UI by right-cpcking on References in the Solution Explorer and then, select Manage NuGet packages. You can now see the currently installed packages.

Those packages are the same ones that are in your project.json file and you can also go to the Browser and add other packages, including pre-released packages, let us say, the MVC framework installed into this project.

If you install this package right now by using the Install button, then this package would be stored in project.json. The frameworks section is another important part of project.json, this section tells ASP.NET as to which of the .NET frameworks your apppcation can use.
"frameworks": { "netcoreapp1.0": { "imports": [ "dotnet5.6", "portable-net45+win8" ] } },
In this case, you will see that "netcoreapp1.0" is the framework used in the project, you can also include the full .NET Framework which is installed when you install Visual Studio.
It is the same .NET Framework that is included with many versions of the Windows Operating System.
It is the .NET Framework that has been around for 15 years, and it includes the frameworks that do everything from web programming to desktop programming.
It is a huge framework that works only on Windows.
“netcoreapp1.0” is the .NET Core framework. It is a cross-platform framework and can work on various platforms, not just Windows but also OS X and Linux.
This framework has fewer features than the full .NET framework, but it does have all the features that we need for ASP.NET Core web development.