Setup for Asp .Net Core 2.0


Microsoft has announced Core 2.0 and it has some awesome features which I will explain in future blog posts.

For now, let us see how to converts your Core 1.0 application into Core 2.0

First of all, we will change the .Net core version in global.json file as shown below:

   "sdk": {
   "version": "2.0.0-preview3-006912"

After that we need to change the target library to Core 2.0 as shown below:


Also, change and update below line in .csproj file:


Once it is done, we need to add below package in the .csproj file:


<PackageReference Include=“Microsoft.AspNetCore.All” Version=“2.0.0” />


This new metapackage contains references to all of the AspNetCore packages and maintains a complete line-up of compatible packages.  You can still include explicit references to specific Microsoft.AspNetCore.* package versions if you need one that is outside of the lineup

Now we need to change PackageTargetFallback in same .csproj file as below:


Here we added AssetTargetFallback instead of earlier PackageTargetFallback

Now let us jump to the Main method in Program.cs class. In Core 1.0 we used to add different extended methods like .UseKestrel(), .UseIISIntegration() etc.

For Core 2.0 it is more simplified as shown below:

using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;

namespace AspNetCoreDotNetCore2._0App
   public class Program
     public static void Main(string[] args)

   public static IWebHost BuildWebHost(string[] args) =>

Now your application is converted into Core 2.0 from Core 1.0


3 thoughts on “Setup for Asp .Net Core 2.0

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s