Visual Studio 2017 ASP. NET Core development, 2017 core
Visual Studio 2017 ASP. NET Core development, Visual Studio 2017 has built-in ASP. NET Core development tools.
After installing the. NET Core function, you can develop ASP. NET Core.
The new ASP. NET Core project is csproj. When the previous xproj project is opened, one-way upgrade will be prompted. After confirmation, it will automatically help you upgrade to csproj.
Create a project
VS 2017 create an ASP. NET Core project:
After confirmation
You can select ASP. NET Core 1.0 and ASP. NET Core 1.1, and enable Docker support.
The following is the project structure for enabling Docker in ASP. NET Core 1.1.
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 supports.
Install the Microsoft. AspNetCore. WebSockets package and add the following in the Configure method of the Startup class:
app.UseWebSockets();
For details, see the official documentation:
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 note that the project reference is greatly simplified.
Right-click to edit the 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: NuGet package
DotNetCliToolReference is an enhanced dotnet command line tool.
Publish an application
Right-click a project and choose publish from the shortcut menu. Then, select a folder.
Click to publish as follows:
You can perform specific settings in the settings following the target location.
Visual Studio 2017 extension is recommended.
Develop ASP. NET Core. The following two extensions are recommended for installation:
Recommended NuGet installation package for the edited csproj File: Project File Tools
Https://marketplace.visualstudio.com/items? ItemName = ms-madsk.ProjectFileTools
ASP. NET Core Tag Helpers smart prompt: Razor Language Services
Https://marketplace.visualstudio.com/items? ItemName = ms-madsk.RazorLanguageServices
You can download and install the tool from the above address, or search for the Installation Tool in tools> extensions and updates:
Two more VS 2017 extensions are recommended below:
Web essenessenweb development tool:
Https://marketplace.visualstudio.com/items? ItemName = MadsKristensen. WebExtensionPack2017
Productivity Power Tools 2017 efficiency development:
Https://marketplace.visualstudio.com/items? ItemName = VisualStudioProductTeam. ProductivityPowerPack2017
As vs7 7 is just available in the official version, there are still some problems.
Specific can go to https://www.visualstudio.com/en-us/news/releasenotes/vs2017-relnotes#a-idknownissues-aknown-issues to view.
If you have any problems, click in the upper right corner to send a feedback report.
Reference: https://blogs.msdn.microsoft.com/webdev/2017/03/07/announcing-visual-studio-2017/
If you think this article is helpful to you, click"Recommendation", Thank you.