Quick summary of what’s changed in ASP.NET Core RC2

Don’t expect any major changes compare to RC1. As most of these are more of forced changes due to renaming. But these are code breaking changes.

The first and most important change is that DNX is gone. And it is replaced by dotnet cli tool. This tool also replaces dnvm (DotNet Version Manager) and dnu (Dotnet Developer Utility).

dnx run and dotnet run commands are different. dnx run makes in-memory compilation where dotnet run is more like a traditional method. Read Difference between “dnx run” and “dotnet run”. So with RC2, incremental compilation is back. Just compile what is changed.

ASP.NET Core is a pure console app. When you create a new ASP.NET Core web application targeting RC2, you will find program.cs file with following line of code.

web.config is back. In RC1, you will find app.UseIISPlatformHandler() in configure method of Startup.cs. But this middleware is not available in RC2. It is replaced with UseIISIntegration(). See static void main code above. The point here is that HttpPlatformModule was replaced by ASP.NET Core Module. And web.config now holds the configuration of ASP.NET Core module.

All Microsoft.AspNet.* namespaces are renamed to Microsoft.AspNetCore.*. The EntityFramework.* packages and namespaces are changing to Microsoft.EntityFrameworkCore. So you need to manually edit your project.json file to update package information while migrating to RC2 from RC1.

All environment variables are now prefixed with the ASPNETCORE_ prefix. So ASPNET_ENVIRONMENT is now ASPNETCORE_ENVIRONMENT.

Till RC1, To use tag helpers in MVC Core, you need to make reference of it in Project.json but with RC2 it is added by default. Also the tag helper package name is changed to Microsoft.AspNetCore.Mvc.TagHelpers

Earlier, IApplicationEnvironment.ApplicationBasePath was used to get the application base path. but now use IHostingEnvironment.ContentRootPath. And ApplicationName property is also moved to IHostingEnvironment. Till RC1,

This is to generate cross-platform PDB files. If the entry is not present then generated PDB files will only be windows based. So if you wish to debug your code on cross-platform, set this to “portable”.

Platform mapping names are changed. So for .NET framework 2 to 4.6, the name would be net20 – net46 and for .NET Core application, it would be netcoreapp. And that’s why you see netcoreapp present in framework section. And within this, you will also see “imports” section which has value like portable-net45+win8. And the description says that it allows packages supporting these frameworks to be installed in this target, regardless of compatibility rules.

Summary

There are many other small points which can be included in this list. But I want to keep this short and simple. If you come across any, please mention in comments section or send it on twitter/facebook. Thank you for reading and I hope it helped you. Keep visiting this blog and share this in your network. Please put your thoughts and feedback in comments section.

PS: If you found this content valuable and want to return the favour, then

Yes. Project.json is going away. Project.json is currently used for all nuget package referencing, project referencing, publish command and etc.. So Post RTM release, this will be replaced with .csproj (as it is today with .NET 4.5 framework). So all project references will be now part of .csproj. Probably they may keep it for nuget references but not clear at this point of time. The reason why they are doing this is because to bring similarity across all project structures.