我創建的應用程序,如主題,只需選擇「ASP.NET核心Web應用程序」,「 NET的核心」,‘ASP.NET 2.0的核心’, 「Web API」。如何承載基本ASP.NET酷睿2的WebAPI應用在IIS
這創建了一個簡單的應用程序,其中'default'調用「api/values」返回JSON數組'[「value1」,「value2」](在瀏覽器中只有一個小警告)。
到目前爲止這麼好。
現在我想上的IIS部署該應用程序,只是用FolderProfile,所以我構建應用程序,我發佈,我有這個目錄中運行它所需的所有文件。我看到添加了一個web.config(它不在源代碼中),使用正確的配置以生成的dll啓動運行時。
我複製此目錄上的物理目錄,我創建一個應用程序池中的網站,總之,一切,我將其配置爲常識所暗示的,因爲我無法找到ASP.NET睿任何補習2.核心1的文檔不正確地應用,因爲有許多變化...
最後,我總是以這樣的結果結束了:
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
生成的web.config是如下:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\Core2WebService.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
<!--ProjectGuid: 5c8e6f19-9a61-47c5-8ee1-8c4b54962ba2-->
我盡我所能,但始終以這種最終結果...任何想法? 謝謝。
......顯然我安裝在目標機器上的ASP.NET的Core 2 SDK ... – Andrea
檢查[在Windows主機,IIS(https://docs.microsoft .com/en-us/aspnet/core/publishing/iis)文檔。現在看起來您至少忘了安裝[.NET Core Windows Server Hosting軟件包](https://aka.ms/dotnetcore.2.0.0-windowshosting) – Set
.NET Core Server Hosting?我在哪裏可以找到這些信息?我安裝了'dotnet-sdk-2.0.0-win-gs-x64':我會試試... – Andrea