So I'm building an MVC6 app in Visual Studio 2015 and have managed to figure most stuff out, however, I haven't yet worked out deployment.
In MVC4 (what I was using before), our process* was publish to a folder, then setup the website in IIS (Right-Click on Sites
-> Add Website
).
I followed this process and obviously it's trivial to setup the IIS website and publish to the correct folder...but that does not actually work for me.
We're running IIS 8 on Windows Server 2012 and we've installed the .Net 4.6 runtime on the server.
On the computer where you have the ASP.NET project open in Visual Studio, right-click the project in Solution Explorer, and choose Publish. If you have previously configured any publishing profiles, the Publish pane appears. Click New or Create new profile. Select the option to import a profile.
The following steps have worked for me and should help you host your project on IIS.
Using Visual Studio 2015 Preview as your IDE,
Once complete, publish the application. In this example, I have selected the location C:\PublishWebApp
.
3.1. When publishing your application, make sure that you have:
Selected amd64
(See image below)
C:\PublishWebApp
.You should see the folders approot
and wwwroot
inside.Create a new website.
6.1 : Select the wwwrooot
folder as the website's physical path. In this example, it is C:\PublishWebApp\wwwroot
.
Check the website to see that it is working. If you encounter any errors, please post them here.
If the precompile option is ticked in the Publish Web Settings window pictured above, then you must
wwwroot
folder of your published web application. In this example, it is C:\PublishWebApp\wwwroot
.web.config
.Inside the folder of your published application, there is an packages
folder inside of the approot
folder which should 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 WebApplication10.
<add key="kre-app-base" value="..\approot\packages\WebApplication10\1.0.0\root" />
I Spent hours on debugging the issue finally got it worked, steps:
1) Publish your MVC6 application using visual studio into file system, make sure you are selecting correct DNX Target version in my case its dnx-clr-win-x64.1.0.0-rc1-update1.
In the output folder map "wwwroot" folder to your applicaiton in IIS (DO NOT Map it to sup-applicaiton, only ROOT application in IIS works with DNX for example "Default Web Site").
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With