2016-06-21 52 views
9

当我尝试使用IIS Server v7.5启动我的ASP.Net核心应用程序时出现以下错误.. 。我将网站(Visual Studio中的文件系统选项)成功发布到特定目录。它从approot/web.cmd文件启动罚款。但是,当我试图把它挂到IIS服务器,它指向wwwroot文件夹中,我得到以下错误:IIS服务器和ASP.Net核心 - 页面无法访问,因为该页面的相关配置数据无效

HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.

  • Detailed Error Information
  • Module IIS Web Core
  • Notification Unknown
  • Handler Not yet determined
  • Error Code 0x8007000d
  • Config Error
  • Config File \?\D:\WebDevelopment\UAT\creativeNamePROD\wwwroot\web.config
  • Requested URL http://10.2.177.226:59/
  • Physical Path
  • Logon Method Not yet determined
  • Logon User Not yet determined
  • Failed Request Tracing Log Directory

下面是两个不同的web.config文件中我想任何一个都不工作。当我尝试进入IIS中的配置编辑器时,我也遇到了一个不清楚的错误。任何帮助将不胜感激!!!

<configuration> 
<system.web> 
    <httpRuntime maxQueryStringLength="64768" maxUrlLength="65536" /> 
</system.web> 
<system.webServer> 
<security> 
    <requestFiltering> 
    <requestLimits maxQueryString="64768" /> 
    </requestFiltering> 
</security> 
<handlers> 
    <add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" /> 
</handlers> 
<httpPlatform processPath="..\approot\web.cmd" arguments="" stdoutLogEnabled="false" stdoutLogFile="..\logs\stdout.log" startupTimeLimit="3600"></httpPlatform> 
</system.webServer> 
</configuration> 

的Web.config#2 -gets同样的错误

<configuration> 
    <system.webServer> 
    <handlers> 
     <add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" /> 
    </handlers> 
    <httpPlatform processPath="..\approot\web.cmd" arguments="" stdoutLogEnabled="false" stdoutLogFile="..\logs\stdout.log" startupTimeLimit="3600"></httpPlatform> 
    </system.webServer> 
</configuration> 
+0

有人吗?任何人都可以提供一个示例web.config文件,为他们使用IIS?将不胜感激! – andre

+0

还没有答案?这是令人失望的。 –

+0

对我来说同样的错误,但只是一个暗示,在我的Windows 10的机器上工作正常,但相同的确切文件,在Win Server 2013 R2上部署,导致上述错误 –

回答

4

这个工作对我来说,删除文件:project.lock.json和运行dotnet restorerestart visual studio

17

我相信我得到这个错误。我没有安装.NET Core Windows Server主机软件包,如instructions like this one中所述。安装完该模块后,我的应用程序即可投入使用(即不出现500错误)。

我看到@耶尔提出在OP此评论了,所以他得到信贷:

Did you install the .NET Core Windows Server Hosting bundle? This is needed for IIS to work as a reverse proxy for the .net core libraries. You'll find the link in this article: docs.microsoft.com/en-us/aspnet/core/publishing/iis I had the same problem before installing this on my dev machine. – Jørgen Tvedt Mar 28 at 6:31