Publish ASPNET 5 MVC 6 on IIS

Using Visual Studio 2015 Preview CTP6.

  1. Create an ASP .NET 5 New App
  2. Check that it is working outside of IIS.
  3. Once complete, publish the application. In this example, I have selected the location C:\MyPublishFolder
    1. When publishing your application, make sure that you have:
    2. Disabled pre-compilation
    3. Selected kre-clr-win-x64.1.0.0-beta3 OR kre-clr-win-x86.1.0.0-beta3 (See image below)

      Publish Screen shot
      Publish Screen shot
    4. Upon a successful publish, go to C:\MyPublishFolder.You should see the folders approot and wwwroot inside.
    5. Now open the IIS Manager (I am assuming you have the ASP .NET 4.5 feature enabled) with IIS 8.5
    6. Create a new website.
      1. Select the wwwrooot folder as the website’s physical path. In this example, it is C:\MyPublishFolder\wwwroot.
    7. Now check the website it is working

If the precompile option is ticked in the Publish Web Settings window pictured above, then you must

  1. Go to the wwwroot folder of your published web application. It is C:\MyPublishFolder\wwwroot
  2. Locate web.config
  3. Inside the folder of your published application, there is a packages folder inside of the approot folder which is contain a folder named after your application, with a folder for the version underneath. Inside that folder should be a folder named root. In web.config, set the value for the key kre-app-base to the root folder. For reference, see the line of code below. In this example, the application name is TestApplication.
  4. <add key=”kre-app-base” value=”..\approot\packages\ TestApplication \1.0.0\root” /> (See image below)
Published Web.Config
Published Web.Config

One thought on “Publish ASPNET 5 MVC 6 on IIS

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