


Detailed explanation of asp.net core examples four (Project.json file)
This article mainly introduces the ASP.NET Core Project.json file in detail, which has certain reference value. Interested friends can refer to it
If you For an application to do any useful work, then you need libraries and frameworks to do the work, store and retrieve data from a database or render complex HTML.
In this chapter, we will discuss the project.json file. This file uses JavaScript object notation to store configuration information and is the core of a .NET application. Without this file, your project would not be an ASP.NET Core project. Here we will discuss some of the most important features of this file. Let's double-click the project.json file to open it.
Currently, the project.json file code implemented by default in a new project 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 } }, "publishOptions": { "include": ["wwwroot", "web.config" ] }, "scripts": { "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] } }
As we can see, at the top we have this file version information. This is the
version you choose to use when compiling your application. The version is 1.0.0, but the most important part of this file is the dependencies.
If your application is going to do any useful work, then you need libraries and frameworks to get the job done, like storing and retrieving data from a database or rendering complex HTML.
In this version of ASP.NET Core, dependencies are managed through the NuGet package manager.
NuGet has been around in .NET for a few years, and now the main way to manage all your dependencies is through the use of the NuGet package manager.
All top-level NuGet packages that your application depends on need to 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
From this file you can see that our application has dependencies on other packages, the exact dependencies may change in the final released version of ASP.NET. When you want to add a new dependency, such as the ASP.NET MVC framework, you can easily write it in this project.json file. When editing this json file, you will also get some smart tips, as follows:
You can use the user interface by right clicking on in the solution explorer Quote , and then select Manage NuGet Packages. You can now see the currently installed packages.
These packages are the same as those in the project.json file. You can also use the browser to add reference packages, such as the following:
If you install this package now by using the install button, then this package will also be stored in the project.json file. The framework section is another important part of project.json, and this tutorial will tell you which .NET frameworks can be used by ASP.NET applications.
"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 add a reference to the .NET framework, the .NET framework is the one you installed in Visual Studio has already been installed.
The above is the detailed content of Detailed explanation of asp.net core examples four (Project.json file). For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Microsoft's Windows 11 2022 Update (22H2) enables CoreIsolation's memory integrity protection by default. However, if you are running an older version of the operating system, such as Windows 11 2022 Update (22H1), you will need to turn this feature on manually. Turn on CoreIsolation's Memory Integrity feature in Windows 11 For users who don't know about Core Isolation, it's a security process designed to protect basic core activities on Windows from malicious programs by isolating them in memory. This process, combined with the memory integrity feature, ensures

Core has two meanings in computers: 1. The core, also known as the core, is the most important component of the CPU. All calculations, accepting storage commands, and processing data of the CPU are performed by the core; 2. Core, core is Intel's processor Name, Core is the processor brand launched by Intel after the Pentium processor. It has currently released twelfth generation Core processors.
![How to Fix Processor Thermal Trip Error in Windows 11/10 [Fix]](https://img.php.cn/upload/article/000/000/164/168169038621890.png?x-oss-process=image/resize,m_fill,h_207,w_330)
Most of the devices, such as laptops and desktops, have been heavily used by young gamers and coders for a long time. The system sometimes hangs due to application overload. This forces users to shut down their systems. This mainly happens to players who install and play heavy games. When the system tries to boot after force shutdown, it throws an error on a black screen as shown below: Below are the warnings detected during this boot. These can be viewed in the settings on the event log page. Warning: Processor thermal trip. Press any key to continue. ..These types of warning messages are always thrown when the processor temperature of a desktop or laptop exceeds its threshold temperature. Listed below are the reasons why this happens on Windows systems. Many heavy applications are in

With the launch of .NETCore, .NET developers have a new opportunity to easily write and run .NET applications on multiple operating systems. This article will delve into how to use .NETCore to achieve cross-platform application development, and share best practice experience on operating systems such as Windows, Linux, and macOS. 1. Prepare the development environment. To start cross-platform application development, you first need to prepare the development environment for each target platform. Windows On Windows, you can install .NETCoreSDK through Visual Studio. After installation is complete, you can create and run .NETCore projects through Visual Studio. Li

CORE coin: Is it worth holding for the long term? CORE coin is a cryptocurrency based on the Proof of Work (PoW) consensus mechanism and was founded by the Core team in 2018. Its goal is to establish a secure, efficient, and scalable digital currency system that is widely used for payment and value storage. CORE coin is designed to provide a decentralized payment solution that provides users with more privacy protection and transaction convenience. Advantages and security of CORE currency: CORE currency is based on the workload proof consensus mechanism and has strong security. Efficient: CORE coin’s transaction speed is fast and can handle thousands of transactions per second. Scalable: CORE coin has a large block capacity and can support a large number of transactions. Decentralization: CORE coin is a decentralized cryptocurrency

Under Linux, core is a memory image with debugging information added. When a program exits or terminates abnormally under Linux, we will use the core file for analysis, which contains information such as memory, registers, stack pointers and other information when the program is running. The format is ELF, which can be understood as dumping the current status of the program into a file.

Roughly one year after announcing the Core Ultra Series 1, also known as Meteor Lake, Intel follows up with the second generation. Core Ultra Series 2 aka Lunar Lake was already introduced at June's Computex. At IFA, the final launch of the Core Ultr

Roughly one year after announcing the Core Ultra Series 1, also known as Meteor Lake, Intel follows up with the second generation. Core Ultra Series 2 aka Lunar Lake was already introduced at June's Computex. At IFA, the final launch of the Core Ultr
