2016-06-21 51 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