ASP.NET 5 项目托管在 IIS 上 [英] ASP.NET 5 project hosting on IIS

查看:31
本文介绍了ASP.NET 5 项目托管在 IIS 上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 Amazon 免费微型实例上托管我的 ASP.NET 5 项目,该项目使用 MVC 6 和 Entity Framework 7.我找不到任何关于如何在 IIS 上托管 ASP.NET 5 项目的分步手册,所有材料都提到这是可能的,但没有任何指南.基本上,我正在部署到本地文件夹,然后复制到新创建的站点,但没有任何效果.不幸的是,我无法使用 Azure,因为它只有一个月的免费试用期,而不是一年.

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.

推荐答案

我正在使用 Visual Studio 2015 Preview 创建 ASP.NET 5 项目.我认为现在在 IIS 上部署并不困难.首先通过在 VS 2015 预览版中将其发布为文件系统来发布您的网站,然后将发布的文件夹复制到您的服务器,在 IIS 中创建一个应用程序并将应用程序文件夹设置为 wwwroot 文件夹(而不是根文件夹),就这样.请注意,在发布之前检查您的网站 project.json 中是否存在Microsoft.AspNet.Server.IIS".

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.

wwwroot文件夹下应该有一个web.config,web.config的内容可能是这样的(发布时有预编译选项):

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="..approotpackages" />
    <add key="bootstrapper-version" value="1.0.0-beta1" />
    <add key="kre-package-path" value="..approotpackages" />
    <add key="kre-version" value="1.0.0-beta1" />
    <add key="kre-clr" value="CoreCLR" />
    <add key="kre-app-base" value="..approotpackagesRvc.PopUpSite1.0.0
oot" />
  </appSettings>
</configuration>

或者像这样(没有预编译选项):

or like this (without precompile option):

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

请注意kre-app-base的值.在 Visual Studio 中发布后,有时它的值为空字符串.

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

这篇关于ASP.NET 5 项目托管在 IIS 上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆