简体   繁体   English

在IIS 8.5上托管Asp.net Core 2.0的问题

[英]Issue hosting Asp.net Core 2.0 on IIS 8.5

I'm setting up a server to host an Application I made with asp.net Core 2.0.3. 我正在设置一个服务器来承载我用asp.net Core 2.0.3制作的应用程序。 I'll be running this App on a Windows Server 2012 R2 server, using IIS 8.5. 我将使用IIS 8.5在Windows Server 2012 R2服务器上运行此应用程序。 I followed this Microsoft Tutorial to set the environment. 我按照此Microsoft教程设置环境。

If I run (dir (Get-Command dotnet).Path.Replace('dotnet.exe', 'shared\\Microsoft.NETCore.App')).Name in the Power Shell. 如果我运行(dir (Get-Command dotnet).Path.Replace('dotnet.exe', 'shared\\Microsoft.NETCore.App')).Name Power Shell中的(dir (Get-Command dotnet).Path.Replace('dotnet.exe', 'shared\\Microsoft.NETCore.App')).Name It tells me I'm running the right version of the runtime environment and by running dotnet MyProject.dll it runs the project on door 5000 and I can access it from the server. 它告诉我我正在运行正确版本的运行时环境,并通过运行dotnet MyProject.dll在5000门上运行该项目,并且可以从服务器访问它。 But when accessing with the server URL this is the page I see: 但是,当使用服务器URL访问时,这是我看到的页面: 在此处输入图片说明

The .Net CLR Version of the application pool is set to No Managed Code and this is my Web.config: 应用程序池的.Net CLR版本设置为“无托管代码”,这是我的Web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <system.webServer>
      <rewrite>
         <rules>
            <clear />
            <rule name="Redirect to https" stopProcessing="true">
               <match url=".*" />
               <conditions>
                  <add input="{HTTPS}" pattern="off" ignoreCase="true" />
               </conditions>
               <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
            </rule>
         </rules>
      </rewrite>
      <modules runAllManagedModulesForAllRequests="false">
         <remove name="WebDAVModule" />
      </modules>
      <handlers>
         <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments="C:\inetpub\wwwroot\MyApp.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
      <security>
         <requestFiltering>
            <requestLimits maxAllowedContentLength="3221225472" />
         </requestFiltering>
      </security>
   </system.webServer>
</configuration>

I Also tried to remove the rewrite rules and nothing changes. 我也尝试删除重写规则,没有任何变化。 And there is no error log created. 并且没有创建错误日志。

I'm lost on what else I can try. 我迷失了其他尝试方法。 Would you have any tips? 你有什么建议吗?

  1. Ensure that you have UrlRewrite IIS extension installed. 确保已安装UrlRewrite IIS扩展。
  2. Ensure that Application Pool identity user IIS AppPool{AppPoolName} must have read permissions on the published website folder 确保应用程序池标识用户IIS AppPool {AppPoolName}必须对已发布的网站文件夹具有读取权限

Go to your published website directory and search for Application Pool Identity user which has format IIS AppPool{AppPool Name} eg IIS AppPool\\DefaultWebsite and give it read permissions 转到您发布的网站目录,并搜索格式为IIS AppPool {AppPool Name}的Application Pool Identity用户,例如IIS AppPool \\ DefaultWebsite并为其授予读取权限

在此处输入图片说明

In IIS Manager select your website in the left pane and then in right pane double click the HandlerMappings icon to ensure that handlers list show up. 在IIS管理器中,在左窗格中选择您的网站,然后在右窗格中双击HandlerMappings图标以确保显示处理程序列表。

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

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