ASP.NET 5 project hosting on IIS

后端 未结 5 1434
一整个雨季
一整个雨季 2020-11-30 06:00

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 pro

相关标签:
5条回答
  • 2020-11-30 06:03

    You can use the File system publish method. Follow these steps:
    1/ Generate in a folder with Visual studio the .dll files
    2/ Create a website in IIS manager and give in the path to your folder

    0 讨论(0)
  • 2020-11-30 06:17

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

    visual studio 2015 publish window

    2. Create a new application in IIS:

    Add website IIS manager button Add website IIS manager window

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

    enter image description here

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

    Install the DNVM - dotnet version Manager (KVM)

    Install the DNX runtime environment inside DNVM (KRE)

    0 讨论(0)
  • 2020-11-30 06:17

    I found what I've missed, I need to change url to my public DNS in 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/

    then after uploading site to Amazon I need to run web.cmd in site root

    0 讨论(0)
  • 2020-11-30 06:19

    I had the same problem with DNX Beta 4.

    If someone has the same problem :

    You have to target x64 framework (Target DNX Version) when you publish your website in Visual Studio 2015 RC and write "XXX\wwwroot" in Physical Path in your IIS website configuration.

    0 讨论(0)
  • 2020-11-30 06:22

    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.

    0 讨论(0)
提交回复
热议问题