Hosting ASP.NET 5 Projects on IIS

I want to host my ASP.NET 5 project that uses MVC 6 and Entity Framework 7 on Amazon's free micro-instance. I canโ€™t find a step-by-step guide on how to host ASP.NET 5 projects in IIS, all the materials just mention that this is possible, but without any tutorials. Basically, I deploy the local folder and then copy to the newly created site, but nothing works. Unfortunately, I canโ€™t use Azure, since it has only one month of free trial, and not a year.

+35
amazon asp.net-mvc iis asp.net-core
Dec 05 '14 at 9:53 on
source share
5 answers

I am using Visual Studio 2015 Preview to create ASP.NET 5 projects. I do not think it is difficult to deploy to IIS right now. First publish your site by publishing it as a file system in VS 2015 preview, then copy the published folder to your server, create the application in IIS and set the application folder to the wwwroot folder (and not the root folder), that's all. Keep in mind, check to see if there is any "Microsoft.AspNet.Server.IIS" on your project.json website before posting it.

Edit: there should be a web.config file in the wwwroot folder, the contents of web.config can be like this (with the option to precompile when publishing):

<?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="kpm-package-path" value="..\approot\packages" /> <add key="bootstrapper-version" value="1.0.0-beta1" /> <add key="kre-package-path" value="..\approot\packages" /> <add key="kre-version" value="1.0.0-beta1" /> <add key="kre-clr" value="CoreCLR" /> <add key="kre-app-base" value="..\approot\packages\Rvc.PopUpSite\1.0.0\root" /> </appSettings> </configuration> 

or like this (without the precompilation option):

 <?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="kpm-package-path" value="..\approot\packages" /> <add key="bootstrapper-version" value="1.0.0-beta1" /> <add key="kre-package-path" value="..\approot\packages" /> <add key="kre-version" value="1.0.0-beta1" /> <add key="kre-clr" value="CoreCLR" /> <add key="kre-app-base" value="..\approot\src\Rvc.PopUpSite" /> </appSettings> </configuration> 

Pay attention to the value of kre-app-base . Sometimes its value is an empty string after publishing to Visual Studio.

+23
Dec 18 '14 at 5:40
source share

1. First you need to publish the site in the file system:

visual studio 2015 publish window

2. Create a new application in IIS:

Add website IIS manager buttonAdd website IIS manager window

3. Unzip the file created in step 1 in the website directory from step 2. The folder should look like this:

enter image description here

4. You may also need to install DNVM (formerly KVM) and the DNX runtime (formerly KRE):

Install DNVM Version Manager - dotnet (KVM)

Install the DNX runtime inside DNVM (KRE)

+3
Dec 6 '14 at 9:54
source share

I had the same problem with DNX Beta 4.

If someone has the same problem:

When publishing your website in Visual Studio 2015 RC, you need to configure the target x64 infrastructure (Target DNX Version) and write "XXX \ wwwroot" on the physical path in the configuration of your IIS site.

+3
May 10 '15 at 21:55
source share

You can use the file system publishing method. Follow these steps:
1 / Create .dll files in a folder with Visual Studio
2 / Create a website in IIS Manager and specify the path to your folder

+1
Dec 05 '14 at 23:27
source share

I found what I missed, I need to change the url to my public DNS in the projct.json file:

"web": "Microsoft.AspNet.Hosting - server Microsoft.AspNet.Server.WebListener --server.urls http://ec2-54-68-21-4.us-west-2.compute.amazonaws.com/

after loading the site in amazon i need to run web.cmd in the root of the site

+1
Dec 6 '14 at 22:30
source share



All Articles