Tru*_*ran 5 c# window-server iis-8.5 .net-core
我将.Net核心项目部署到Windows Server 2012 R2 64位,发生了这种情况:
HTTP错误502.5-根据Microsoft指南的处理失败,他们说这是由于平台与RID冲突。
(https://docs.microsoft.com/zh-cn/aspnet/core/publishing/iis?tabs=aspnetcore2x#common-errors)
我已经完成了该指南中的所有步骤,但是无法解决。有人知道如何解决这个问题吗?如果可以的话,我将不胜感激。谢谢。
注意:我已经给了publish文件夹完全权限,并且还安装了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>
Run Code Online (Sandbox Code Playgroud)
和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-->
Run Code Online (Sandbox Code Playgroud)
我遇到了这个问题:IIS无法运行ASP.NET Core站点-HTTP错误502.5 似乎正是我的问题。但是我在任何地方都找不到.exe文件。:(
小智 0
只是需要仔细检查一下,您是否设置了默认文档?
此外,在 IIS 中,如果您运行的是 .net 2.0 项目,则可能必须将此部署的应用程序池管道从集成切换为经典,并将 .NET CLR 版本切换为 2.0。
取决于您使用的 .net 版本。
| 归档时间: |
|
| 查看次数: |
4286 次 |
| 最近记录: |