简体   繁体   中英

IIS 502.5 error when publishing aspnetcore web api in sub-folder of root

I have two applications totally independent as:

  1. Angular 6 app
  2. AspNetCore Web Api

I tried publishing AspNetCore web app in my www.xxx.com( D:ABCPub\\wwwroot ) root of IIS without any problem and my web api works like a charm, but the issue is when I tried to put my published files in www.xxx.com/mywebapi( D:ABCPub\\wwwroot\\mywebapi ) it gives me error as below: 在此处输入图片说明 Given that currently my root D:ABCPub\\wwwroot is totally empty except the folder mywebapi which contains all the published files.

Below is my web.config( D:ABCPub\\wwwroot\\mywebapi\\webconfig ) file:

<?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-->

I think I am doing some silly mistake here, but not able to get it, any help would be appreciated.

The AspNetCoreModule is configured via the web.config file found in the application's root, which points a the startup command (dotnet) and argument (your application's main dll) which are used to launch the .NET Core application. The configuration in the web.config file points the module at your application's root folder and the startup DLL that needs to be launched.See here .

Try to add arguments=".\\ABCPub.dll" in the web.config like below

<aspNetCore processPath="dotnet" arguments=".\ABCPub.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM