在root的子文件夹中发布aspnetcore web api时出现IIS 502.5错误

问题描述 投票:0回答:1

我有两个完全独立的应用程序:

  1. Angular 6 app
  2. AspNetCore Web Api

我尝试在我的www.xxx.com(D:ABCPub\wwwroot)IIS的根目录中发布AspNetCore网络应用程序没有任何问题,我的网络api就像一个魅力,但问题是我试图将我发布的文件放在www.xxx.com/ mywebapi(D:ABCPub\wwwroot\mywebapi)它给了我如下错误:enter image description here鉴于目前我的rootD:ABCPub\wwwroot完全是空的,除了包含所有已发布文件的文件夹mywebapi

下面是我的web.config(D:ABCPub\wwwroot\mywebapi\webconfig)文件:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath=".\MyProject.Service.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: AD1729B0-5EEA-46C7-B21F-349377540A21-->

我想我在这里做了一些愚蠢的错误,但是无法得到它,任何帮助都会受到赞赏。

iis azure-devops asp.net-core-webapi octopus-deploy
1个回答
0
投票

AspNetCoreModule是通过应用程序根目录中的web.config文件配置的,该文件指向用于启动.NET Core应用程序的启动命令(dotnet)和参数(应用程序的主dll)。 web.config文件中的配置将模块指向应用程序的根文件夹和需要启动的启动DLL。请参阅here

尝试在web.config中添加arguments =“。\ ABCPub.dll”,如下所示

<aspNetCore processPath="dotnet" arguments=".\ABCPub.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
© www.soinside.com 2019 - 2024. All rights reserved.