繁体   English   中英

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

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

我正在设置一个服务器来承载我用asp.net Core 2.0.3制作的应用程序。 我将使用IIS 8.5在Windows Server 2012 R2服务器上运行此应用程序。 我按照此Microsoft教程设置环境。

如果我运行(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 它告诉我我正在运行正确版本的运行时环境,并通过运行dotnet MyProject.dll在5000门上运行该项目,并且可以从服务器访问它。 但是,当使用服务器URL访问时,这是我看到的页面: 在此处输入图片说明

应用程序池的.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>

我也尝试删除重写规则,没有任何变化。 并且没有创建错误日志。

我迷失了其他尝试方法。 你有什么建议吗?

  1. 确保已安装UrlRewrite IIS扩展。
  2. 确保应用程序池标识用户IIS AppPool {AppPoolName}必须对已发布的网站文件夹具有读取权限

转到您发布的网站目录,并搜索格式为IIS AppPool {AppPool Name}的Application Pool Identity用户,例如IIS AppPool \\ DefaultWebsite并为其授予读取权限

在此处输入图片说明

在IIS管理器中,在左窗格中选择您的网站,然后在右窗格中双击HandlerMappings图标以确保显示处理程序列表。

暂无
暂无

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

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