New ASP.NET Features and Fixes in Visual Studio 2015 RC

Today Scott Hanselman announced the Release Candidate of Visual Studio 2015, Team Foundation Server 2015 and Visual Studio 2013 Update 5. We hope that all //build attendees are enjoying the show, and we are following up on the news of the Visual Studio 2015 Release Candidate to show you some of the cool new features delivered in this version for web developers. With the Visual Studio 2015 release candidate we are delivering updates for ASP.NET 4.6 and our next generation ASP.NET 5 framework. You can read more about ASP.NET 5 online at http://www.asp.net/vnext and review the new open source documentation for ASP.NET 5 at http://docs.asp.net Let’s take a look at the new features delivered in the Visual Studio 2015 release candidate for ASP.NET 4.6 and the ASP.NET 5 beta4 preview:

The Big Rename

If you’ve been following the previous releases of Visual Studio 2015 and the nightly builds of ASP.NET, you have no doubt been familiar with the Project K executables: k.exe, klr.exe, kpm.exe, and kvm.exe In order to drop the Project K codename and move to a more market-friendly name of the ASP.NET tooling, these command-line tools and the K-Runtime were renamed as follows:

k and klr are now DNX. DNX stands for .NET Execution Environment.

kvm is now dnvm or the .NET Version Manager

kpm is migrating some functionality of its functionality to dnu, the .NET Development Utility and some functionality will migrate to be core NuGet functionality

The Aspnet50 and aspnetcore50 framework monikers in project.json files are being replaced with dnx451 and dnxcore50.

The ASP.NET 5 Community Standup has a video discussing the rename decision in depth. That video is from some time ago that refers to nightly builds or “daily bits”, those changes have been completed and are in this release.

New Project Templates and Project Types

In the prior versions of Visual Studio 2015, we made project types available for Project K class library and Project K console applications. These project type names don’t make sense in our new world and we have renamed them appropriately:

Class Library (Package) is a class library project that is configured to allow you to build reference libraries that compile directly into NuGet packages. Console application is a similar project that allows console applications to be built in the same model as an ASP.NET 5 web application, referencing NuGet packages and configuring multiple frameworks to build against. Both of these project types allow the developer to configure everything with a project.json file and target the .NET Core framework.

We’ve also simplified and updated the ASP.NET web project templates in this release. There are clear dividing lines between the ASP.NET 4.6 and ASP.NET 5 projects, as well as updated templates for a Single Page Application and Azure Mobile Service:

Add Missing NuGet Packages in ASP.NET 5

Our favorite new feature for ASP.NET 5 developers is the cool new feature to help you add the correct NuGet packages to your project for the types that you are referencing. In the ASP.NET 5 environment, all references are NuGet packages, and how will you know which ones to add when you just want to light-up that XDocument type to work with an XML document? In an ASP.NET 5 web project or class library project, you can just press CTRL + . (period) to activate a helper in the editor that will offer to add the missing package to your project:

The editor will suggest the package to add and show you the changes that it is going to make to the Using statements at the top of the code file in order to allow your code to function properly.

Performance Updates for ASP.NET 5

We focused a significant amount of time on improving the performance of the Visual Studio developer experience. In this release, you should see a noticeable speed increase when opening existing solutions with ASP.NET 5 projects as well as launching the application. There are a number of other less important performance tweaks under the hood for ASP.NET 5 projects as well.

Editor Improvements to Support TagHelpers

TagHelpers for ASP.NET MVC were introduced in an earlier preview, but in this release they really come into their own. TagHelpers provide a simple tag experience in the razor editor that allow you to execute code on the server and inject content in the output. Scott Hanselman and Jeff Fritz have posts that introduce and demonstrate how to start writing your first TagHelper. The ASP.NET Community standup discussed TagHelpers in March 2015.

We have added editor support so that you can easily see where your .NET code will take over rendering your HTML. With bold tag names and intellisense support for attributes, coding HTML with these complex server-side interactions has become easier than ever.

Add Reference to Project

We’ve re-introduced the ability to add references to an ASP.NET 5 project from standard class library projects. In the image above, the ClassLibrary1 project is a standard class library, while the TagHelperSample.Helpers project is an ASP.NET 5 specific class library. Both library types are supported interchangeably now.

Cleaned Up Solution Explorer with Automatic File Nesting

With ASP.NET 5, we’ve promoted the fact that ASP.NET developers should start to use more standard web practices for acquiring, minifying, and otherwise processing your static resources before they are served to your web application’s visitors.

To help make the display of minified resources easier to review in your solution explorer, any files with an extension of min.css or min.js will be nested automatically under the un-processed version of that file. We hope that you find this to be a useful addition to the solution explorer.

Local IIS Express Custom Configuration

If you were finding that you were constantly updating your applicationHost.config file on your machine each time you started a new project, then this feature will be a welcome change. With the new ASP.NET tooling, your custom IIS web server configurations are stored in the solution’s .vs folder in an applicationHost.config file. This should help isolate your web server configurations for each of your projects without conflicting references to a single configuration file.

Security Updates for ASP.NET

There are a number of security-focused updates in this release for both ASP.NET 4.6 and ASP.NET 5:

ASP.NET 4.6

Updates to templates using “Work And School Account” for Authentication. This also includes fixes to Domain picker used to select your tenant.

The individual web site authorization template option now allows developers to configure social logins, account confirmation, and two-factor authentication.

Templates are using Gulp.

SSL can be configured from web project property pages.

The ASP.NET authorization library now allows for authorization using policies.

Web Projects can now be configured to use Windows authentication.

Custom Launch Settings are saved as Project Properties

If you want to lock in the version of the framework that your project for compilation and debugging, those settings are now saved with your project in the new launchSettings.json file in your project properties folder. This means that all of your team members will have the same debugging configuration when they synchronize source code.

Additionally, we have simplified the format of this configuration file to make it easier to read and work with:

ASP.NET 4.6 Improvements

We have a number of updates for ASP.NET 4.6 which includes Web Forms, MVC 5 and Web API 2. These include support for .NET Compiler Platform (Roslyn), hosting changes in IIS to support HTTP/2 and more. Read this post for more details.

Summary

We are working on evolving the ASP.NET environment and tooling. This might be a release candidate build for Visual Studio, but we are looking at the big picture for ASP.NET. We will continue to develop at the same pace in the open at http://github.com/aspnet/home. We are building and releasing our libraries and updates for Visual Studio with the updates delivered on NuGet and the Visual Studio Extension Gallery. Keep an eye on our blog to hear about our next set of features.

Tags

Join the conversation

I'm still finding the link between asp.net 5 and .net core to be a bit confusing. Sometimes asp.net 5 sounds like it is the new .net regardless of whether you are making a web site/service or not. Maybe related, it seems really odd to have a console project type listed under Web. Maybe this is all things to be resolved for RTM.

@Mark – good questions. ASP.NET 5 is brand new and has cross-platform capabilities as well as being 100% open-source. In order to support running websites in different architecture models on different platforms, its somewhat necessary to be able to build a console application for OSX or Linux.

We'll have a post next week explaining the differences between ASP.NET 4.6, ASP.NET 5 and how the various UI frameworks are used

@Mark, ASP.NET 5 can run on both .NET full framework as well as on .NET Core. .NET core has a smaller foot print when compared to .NET full framework. You only reference what you need and everything will be delivered via Nuget. One of the key points is, .NET full framework is a machine wide framework, while .NET Core can be application wise. Basically with .NET Core, you get the chance of creating your own.NET framework!

I've recently been doing extensive work automating the generation of enterprise conventions inside the .csproj and web.config/app.config. With the transition to json, can anyone confirm whether the older XML strategy will still be supported? (I still prefer XML when not transmitting data over the wire.)

Does this VS version includes the possibility of building VNext sites on VS online?

I know this this still a beta version, but would you say that this version of ASP.NET 5 is sufficiently stable(ish) as to start working on it for future production projects, or is there still the possibility for some big breaking changes ahead?

Does the missing Nuget package feature only work for MS packages? Or if I am coding against a platform like DNN or Orchard which might have their own Nuget packages, will this feature pick up types from their Nuget packages as well? What about type disambiguation?

"Add Reference to Project" mentions the ability to reference an ASP.NET 5 project / class library from a classic *.csproj. I'm trying this, but constantly get the error message "A reference to '…' could not be added".

Is there a way to turn off the 'Automatic File Nesting' feature for ASP.NET 5 projects? Or at least tell it what file types to exclude? In my case, it's TypeScript files being automatically nested under .html files of the same name that makes things messy…

Is there going to be backwards support for our websites that do not use a web.config file? I am seeing that .json will replace all config settings, is this in lieu of azure setup changes to come as well?

can you import a class library project written in .net4 into a asp.net 5 solution. I can't get the references to resolve! It appears to have wrapped the project fine. I also tried importing a .net4.5 class library project and that worked fine. Is there a problem importing a .net 4 project into an aps.net 5 solution? Will this be available in the final release?

Ok. This took me half of the afternoon. I installed the RC today and wondered about the 500.19 errors saying i can't use something like

<windowsAuthentication enabled="false" />

in my web.config.

I checked my IIS Express applicationhost.config under my user profile again and again and couldn't find out what's wrong since overrideModeDefault="Allow" was set. After hours I found this article telling me there is another "custom" applicationhost.config now…

To be honest. I don't see a need for an additional configuration layer here. It just adds more confusion in my opinion. But what really wonders me… Shouldn't all the values from the profile wide applicationhost.config be copied at the creation of the project level applicationhost.config??? Why does it reset important bits and break existing code?

Any hints as to where/how to enable XML doc processing for Asp.Net 5 web service projects. It doesn't seem to be one of the options I can set in the compiler section of project.json – though other compiler settings moved there from web.config. Not part of build settings anymore…