2017-10-13 166 views
1

我部署了我的.Net核心項目窗口服務器2012 R2 64位,這發生了:部署.NET的核心項目,窗口服務器2012 R2

enter image description here HTTP錯誤502.5 - 過程失效根據微軟的指導,他們說,這是因爲平臺與RID衝突。

https://docs.microsoft.com/en-us/aspnet/core/publishing/iis?tabs=aspnetcore2x#common-errors

我已通過該指南中的每一步已經來但不能修復它。那麼有誰知道如何解決這個問題?如果可以,我將不勝感激。謝謝。

注意:我已經給出了發佈文件夾的完整權限,並且還安裝了ASPNetCoreModule v2.0,net core sdk 2.0。我的IIS版本是8.5。

這裏是我的.csproj:

<Project Sdk="Microsoft.NET.Sdk.Web"> 

    <PropertyGroup> 
    <TargetFramework>netcoreapp2.0</TargetFramework> 
    <RootNamespace>_MyAppAPI</RootNamespace> 
    <AssemblyName>_MyAppAPI</AssemblyName> 
    </PropertyGroup> 

    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> 
    <DocumentationFile></DocumentationFile> 
    </PropertyGroup> 

    <ItemGroup> 
    <Content Remove="wwwroot\swagger\authen\basic-auth.js" /> 
    <Content Remove="wwwroot\swagger\ui\custome.css" /> 
    </ItemGroup> 

    <ItemGroup> 
    <Folder Include="Middleware\" /> 
    <Folder Include="Logs\" /> 
    <Folder Include="Models\appapi\" /> 
    <Folder Include="wwwroot\lib\" /> 
    <Folder Include="wwwroot\logs\" /> 
    </ItemGroup> 

    <ItemGroup> 
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" /> 
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.0" /> 
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.0" /> 
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.0" /> 
    <PackageReference Include="Serilog.Extensions.Logging.File" Version="1.1.0" /> 
    <PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" /> 
    </ItemGroup> 

    <ItemGroup> 
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" /> 
    </ItemGroup> 

    <ItemGroup> 
    <EmbeddedResource Include="wwwroot\swagger\authen\basic-auth.js" /> 
    <EmbeddedResource Include="wwwroot\swagger\ui\custome.css" /> 
    </ItemGroup> 

</Project> 

而且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=".\_MyAppAPI.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" /> 
    </system.webServer> 
</configuration> 
<!--ProjectGuid: 2510f4bb-368b-4ab2-96e1-5d06b14d677e--> 

我碰到了這樣:IIS fails to run ASP.NET Core site - HTTP Error 502.5 似乎正是我的問題。但是我無法在任何地方找到.exe文件。 :(

+0

你能告訴我們更多關於你是如何發佈應用程序嗎?你能不能給我們csproj? –

+0

@IvanMilosavljevic嗨。我只需更新我的csproj文件和web.config。 –

+0

你如何部署/發佈項目? –

回答

0

只是要仔細檢查,你有沒有設置默認文件?

此外,在IIS,你可能要切換應用程序池管道此部署從集成經典和.NET CLR版本2.0,如果您運行的是.NET 2.0的項目。

根據您所使用的.NET版本。