Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET 5 project hosting on IIS

I want to host my ASP.NET 5 project which uses MVC 6 and Entity Framework 7 on Amazon free micro instance. I can't find any step-by-step manual on how to host ASP.NET 5 projects on IIS, all materials just mention that this is possible but without any guides. Basically, I'm deploying to local folder and then copying to newly created site, but nothing is working. Unfortunately, I can't use Azure as it only has one month free trial, not a year.

like image 727
Sergey Sypalo Avatar asked Dec 05 '14 21:12

Sergey Sypalo


People also ask

How do I host a project on IIS?

Go to Control Panel > Administrative Tools > Internet Information Services (IIS) Manager. In the Connections panel, expand your host tree, right-click on Sites, and choose Add Website. Enter the new website's name and choose the location. Enter the Host name.

Does IIS support .NET Core?

You Need The ASP.NET Core Hosting BundleNET Core to work inside IIS, you actually need to do an install of a “Hosting Module” so that IIS knows how to run your app.

Does .NET run on IIS?

IIS 8.0 supports running both ASP.NET 3.5 and ASP.NET 4.5 applications on the same machine using different application pools to host each . NET Framework version. IIS 8.0 supports for multiple .


1 Answers

I'm using Visual Studio 2015 Preview to create ASP.NET 5 projects. I don't think that's difficult to deploy on IIS now. First publish your website by publishing it as file system in VS 2015 preview, then copy the published folder to your server, create an application in IIS and set the application folder to the wwwroot folder (rather than the root folder), that's all. Be aware, check if "Microsoft.AspNet.Server.IIS" exists in your website project.json before publishing it.

Edit: there should be a web.config in wwwroot folder, the content of web.config may be like this (with precompile option 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 precompile 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> 

Please notice the value of kre-app-base. Occasionally its value is empty string after publishing in Visual Studio.

like image 60
Ricky Avatar answered Sep 24 '22 00:09

Ricky