加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 将.net核心项目部署到Windows Server 2012 r2

发布时间:2020-12-15 21:07:55 所属栏目:百科 来源:网络整理
导读:我将.Net核心项目部署到窗口服务器2012 R2 64位,这发生了: HTTP错误502.5 – 根据Microsoft指南处理失败,他们说这是因为平台与RID冲突. (https://docs.microsoft.com/en-us/aspnet/core/publishing/iis?tabs=aspnetcore2x#common-errors) 我已经完成了该指
我将.Net核心项目部署到窗口服务器2012 R2 64位,这发生了:

enter image description here


HTTP错误502.5 – 根据Microsoft指南处理失败,他们说这是因为平台与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="wwwrootswaggerauthenbasic-auth.js" />
    <Content Remove="wwwrootswaggeruicustome.css" />
  </ItemGroup>

  <ItemGroup>
    <Folder Include="Middleware" />
    <Folder Include="Logs" />
    <Folder Include="Modelsappapi" />
    <Folder Include="wwwrootlib" />
    <Folder Include="wwwrootlogs" />
  </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="wwwrootswaggerauthenbasic-auth.js" />
    <EmbeddedResource Include="wwwrootswaggeruicustome.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=".logsstdout" />
  </system.webServer>
</configuration>
<!--ProjectGuid: 2510f4bb-368b-4ab2-96e1-5d06b14d677e-->

我碰到了这个:IIS fails to run ASP.NET Core site – HTTP Error 502.5
似乎是我的问题.但我无法在任何地方找到.exe文件.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读