Home > 5.0 > How to run ASP.NET 5.0 from Visual Studio 2015

How to run ASP.NET 5.0 from Visual Studio 2015

While it might be strange, if you have not upgraded to RC1, you might encounter issues running ASP.NET 5 websites because its now in beta8 whereas the default template on VS 2015 assumes you only have beta5 installed.


ASP.NET 5.0 on BETA 5

  1. Goto File –> New –> Web Application
  2. Create a Preview ASP.NET 5.0 WebAPI project
  3. Once VS loads up, you still see a whole bunch of errors (look at the circled portion)
  4. In order to make it work, you need to enable beta5 clr. To do so, use the following commands

    dnvm use 1.0.0-beta5 -arch x64 -r coreclr –p
    dnvm alias default 1.0.0-beta5 x64 coreclr


  5. Then run dnu restore
  6. You will also need to modify globals.json just to be sure it runs the correct CLR
  7. Once all is done, just run dnx . web to start the webserver
  8. clip_image001



ASP.NET 5.0 on BETA 8

There are a breaking changes between BETA5 and BETA8 e.g AspNet.Hosting has been replaced with IISPlatformHandler

  1. Make sure you set Beta8 as the new default

    dnvm use 1.0.0-beta8 -arch x64 -r coreclr –p
    dnvm alias default 1.0.0-beta8 x64 coreclr

  2. Modify project.json to reflect the breaking changes in beta8

    "dependencies": {
    "Microsoft.AspNet.Mvc": "6.0.0-*",
    "Microsoft.AspNet.StaticFiles": "1.0.0-*",
    "Microsoft.AspNet.IISPlatformHandler": "1.0.0-beta8",
    "Microsoft.AspNet.Server.WebListener": "1.0.0-beta8",
    "Microsoft.AspNet.Server.Kestrel": "1.0.0-beta8",

    "commands": {
    "web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener –server.urls http://localhost:5000",
    "kestrel": "Microsoft.AspNet.Server.Kestrel",

  3. Now run dnu restore to restore all the nuget packages
  4. You can now run either IIS Express or Kestrel for DNX projects
  5. For the difference between the web servers, you can refer to https://github.com/aspnet/Home/wiki/Servers

Categories: 5.0
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

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

WordPress.com Logo

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

Google+ photo

You are commenting using your Google+ 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

%d bloggers like this: