Posted by Anuraj on Thursday, March 9, 2017
This post is about new features of Visual Studio 2017 for Web Developers. The new features inclues ASP.NET Core tooling, CSProj support, Migration option from project.json to csproj, client side debugging improvements etc.
As part of the release, Microsoft released the RTM version of ASP.NET Core Tooling. In VS 2017 the csproj tooling is enabled. ASP.NET Core is available in the Web and .NET Core sections of new projects. The ASP.NET Core project template screen has some changes, and still makes available the choice of three web templates: Empty, API, and Web Application.
In the new ASP.NET Core project dialog, you can choose the runtime, ASP.NET Core 1.0 or 1.1. Also you can choose Enable Container support for the projet, which will add DockerFile, for building container images, Docker Compose project to define how you instance your containers, and Multi-project/container debugging support for Containers.
In the Web Application template, both Package.json file and gulpfile.js is removed. Bower is enabled by default, which will deliver bootstrap, jQuery, and jQuery validation libraries and added to the wwwroot/lib folder by default. For bundling and minification, bundleconfig.json is added instead of gulp tasks.
With Visual Studio 2017 and .NET Core SDK 1.0, CSProj files are exclusively supported. Your existing project.json files will be migrated to csproj format, when you open the project in Visual Studio first time. You can use
dotnet migrate command to migrate the project.json to csproj. Visual Studio is also executing the same command to migrate the projects. You can edit the project file directly in Visual Studio, no need to unload and edit.
The new CSProj format is simpler, there is no GUIDs :)
In the project file now has the following features activated by default.
An “Sdk” attribute on the Project root-element that is set to “Microsoft.NET.Sdk.Web”. This instructs the project system to manage this project with tooling to support an ASP.NET Core project that delivers a web endpoint with appropriate defaults.
A collection of “PackageReference” elements. These items are NuGet packages that should be installed and referenced by our project. The packages.config file is no longer needed. This is same as the dependencies in the project.json file.
A collection of “DotNetCliToolReference” elements. These items enhance the dotnet command-line tool to give it features necessary to build and manage this project. This is similar to the tools section in the project.json file.
It is a .NET Core tooling feature, than a Visual Studio 2017 feature. Now you can create Empty Web app, API app, MS Test and Solution file as part of dotnet new command.
Additionally, it is very easy to create your own templates or download other templates to use. Instructions for building your own templates are on the project templates wiki.
Right now Edge and Firefox is not supported.
Visual Studio 2017 helps developers to containerize ASP.NET applications as well. You can use the same commands to add Windows container support to your favorite ASP.NET Web Forms, MVC, or Web API projects easily. These applications will launch and run inside of a Windows container that is configured with IIS and the latest version of the .NET Framework.
You need to enable Container support if you’re running Windows 10. Also make sure you have latest version of Docker for Windows is running and you have selected the Windows container option from Docker tray icon.
Happy Programming :)