简体   繁体   English

在IIS上使用.NET Core运行ASP.NET 5(MVC 6)

[英]Run ASP.NET 5 (MVC 6) using .NET Core on IIS

I have just created a quick ASP.NET 5 MVC 6 app on Visual Studio.NET 2015 RC and would like it to run on my IIS web server on Windows 7. 我刚刚在Visual Studio.NET 2015 RC上创建了一个快速的ASP.NET 5 MVC 6应用程序,并希望它在Windows 7上的IIS Web服务器上运行。

Normally, when I create a website on IIS, I need to choose an Application Pool, either v2.0 or v4.0 Integrated. 通常,当我在IIS上创建网站时,我需要选择一个应用程序池,v2.0或v4.0 Integrated。

Now because .NET Core comes with all its libraries as nuget packages, how can I run it on IIS? 现在因为.NET Core附带了所有库作为nuget包,我怎么能在IIS上运行它? which application pool do I pick? 我选择哪个应用程序池? how does this work? 这是如何运作的?

Update 更新

As @wickdninja stated, the below is outdated. 正如@wickdninja所说,以下是过时的。 Use his updated solution instead : https://docs.microsoft.com/en-us/aspnet/core/publishing/iis To get the application to run on IIS: 请改用他更新的解决方案https//docs.microsoft.com/en-us/aspnet/core/publishing/iis要使应用程序在IIS上运行:


  1. Create a website under a v4.0 app pool. 在v4.0应用程序池下创建一个网站。
  2. Bundle/publish the application using dnu publish . 使用dnu publish捆绑/发布应用程序。 This will create a self contained package that has the application, the runtime and all the dependencies. 这将创建一个自包含的包,其中包含应用程序,运行时和所有依赖项。 Change the runtime name to match the runtime of your choice. 更改运行时名称以匹配您选择的运行时。

      dnu publish --runtime dnx-coreclr-win-x86.1.0.0-beta5-11625 

    You can even pass --no-source if you don't want the application to be compiled from sources every time it starts. 如果您不希望每次启动时都从源编译应用程序,您甚至可以传递--no-source

  3. Copy the bundle (from bin\\output ) under the website root. 从网站根目录下复制捆绑包(从bin\\output )。

  4. Run

Things that might go wrong: 可能出错的事情:

  1. The IIS bitness (32/64 bit) must match the bitness of coreclr. IIS位(32/64位)必须与coreclr的位数匹配。
  2. If you don't copy the bundled website under the website root, make sure the account under which IIS runs can actually access the runtime folder. 如果不在网站根目录下复制捆绑的网站,请确保运行IIS的帐户可以实际访问运行时文件夹。

This question is out of date, and Microsoft has since release pretty thorough documentation for this scenario. 这个问题已经过时了,微软已经为这个场景发布了相当全面的文档。 You can find it here: https://docs.microsoft.com/en-us/aspnet/core/publishing/iis 你可以在这里找到它: https//docs.microsoft.com/en-us/aspnet/core/publishing/iis

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM