Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to develop ASP.NETCore in VisualStudio2017

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

In this issue, the editor will bring you about how to develop ASP.NETCore in VisualStudio2017. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

Visual Studio 2017 ASP.NET Core development, Visual Studio 2017 has built-in ASP.NET Core development tools.

After choosing the .NET Core feature installation, you can do ASP.NET Core development.

The new ASP.NET Core project is csproj. If you open the previous xproj project, you will be prompted for an one-way upgrade. After confirmation, you will automatically upgrade to csproj.

New project

VS 2017 create a new ASP.NET Core project:

After confirmation

ASP.NET Core 1.0 and ASP.NET Core 1.1 can be selected, and Docker support is enabled.

The following is the structure of the ASP.NET Core 1.1 enabling Docker support project.

The project can be run on Docker, and Docker must be installed locally if you want to debug in Docker.

Some new features have been added to ASP.NET Core 1.1. For example: WebSockets support.

Install the Microsoft.AspNetCore.WebSockets package, and then add to the Startup class Configure method:

App.UseWebSockets ()

For more information, please refer to the official documents:

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 to the project is greatly simplified.

Right-edit the csproj file:

Netcoreapp1.1 $(PackageTargetFallback); portable-net45+win8+wp8+wpa81;..\ docker-compose.dcproj

PackageReference is the NuGet package

DotNetCliToolReference is an enhanced dotnet command line tool

Publish the application

Right-click on the project to select publish, and then select folder

Click publish as follows:

Some specific settings can be made in the settings behind the target location.

Recommend Visual Studio 2017 extension

To develop ASP.NET Core, the following two extensions are recommended to be installed:

The edited csproj file recommends the NuGet installation package: 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 the installation according to the address above, or you can search for the installation in tools-> extensions and updates:

The above is the editor for you to share how to develop ASP.NETCore in VisualStudio2017, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report