Visual Studio 2017 ASP. Net core development

Time:2022-1-8

Visual Studio 2017 ASP. Net core development, visual studio 2017 has built-in ASP Net core development tool

In the selection ASP. Net core function can be implemented after installation Net core development.

New ASP Net core project is csproj. When you open the previous xproj project, you will be prompted for one-way upgrade. After confirmation, you will be automatically upgraded to csproj.

New project

Vs 2017 new ASP Net core project:

After confirmation

Optional ASP Net core 1.0 and ASP Net core 1.1 and enable docker support.

The following is ASP Net core 1.1 enables docker to support project structure.

The project can run on docker. If you want to debug docker, you must install docker locally.

ASP. Net core 1.1 adds some new features. For example: WebSockets support.

Install Microsoft AspNetCore. WebSockets package, and then add in the configure method of startup class:

app.UseWebSockets();

See the official documents for details:

https://docs.microsoft.com/en-us/aspnet/core/aspnetcore-1.1#choosing-between-versions-10-and-11-of-aspnet-core

. net core csproj support

In the csproj file of the project, you can notice that the reference of the project is greatly simplified.

Right click to edit csproj file:


<Project Sdk="Microsoft.NET.Sdk.Web">

 <PropertyGroup>
 <TargetFramework>netcoreapp1.1</TargetFramework>
 </PropertyGroup>

 <PropertyGroup>
 <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
 <DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
 </PropertyGroup>
 <ItemGroup>
 <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
 <PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
 <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
 <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.1" />
 <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
 <PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.0" />
 </ItemGroup>
 <ItemGroup>
 <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0" />
 </ItemGroup>

</Project>

Packagereference is nuget package

Dotnetclitoolreference is an enhanced dotnet command line tool

Publish application

Right click the project, select publish, and then select folder

Click to publish as follows:

Specific settings can be made in the settings behind the target location.

Recommended visual studio 2017 extensions

Develop ASP Net core, the following two extensions are recommended:

Recommended nuget installation package for edited csproj files: Project File tools

https://marketplace.visualstudio.com/items?itemName=ms-madsk.ProjectFileTools

ASP. Net core tag helpers smart tip: Razor language services

https://marketplace.visualstudio.com/items?itemName=ms-madsk.RazorLanguageServices

You can download and install according to the above address, or search for installation in tools – > extensions and updates:

Two more vs 2017 extensions are recommended below:

Web essentials web development tool:

https://marketplace.visualstudio.com/items?itemName=MadsKristensen.WebExtensionPack2017

Productivity power tools 2017 efficiency development:

https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.ProductivityPowerPack2017

Since vs2017 has just released its official version, there are still some problems.

You can gohttps://www.visualstudio.com/en-us/news/releasenotes/vs2017-relnotes#a-idknownissues-aknown-issuessee.

If you encounter a problem, you can click on the top right to send a feedback report.

Reference documents:https://blogs.msdn.microsoft.com/webdev/2017/03/07/announcing-visual-studio-2017/

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support developpaer.

Recommended Today

permutation – full permutation

full permutation problem Topic description output natural numbers in lexicographical order\(1\)arrive\(n\)All non-repeating permutations, i.e.\(n\)The full permutation of , requires that no duplicate digits are allowed in any sequence of digits generated. input format an integer\(n\)。 output format Depend on\(1 \sim n\)Consists of all distinct sequences of numbers, one sequence per line. reserved for each number\(5\)field […]