简体   繁体   中英

Hosting two asp.net core projects in one IIS application pool

I'm trying to host two ASP.Net core application in one IIS app pool. I've created application pool and site which is linked to inetpub/myapps/myapp1 folder, then I chose Add Application in newly created site linked to inetpub/myapps/myapp2 with alias: myapp2 There is web.config in myapp1 folder with following content:

<system.webServer>
    <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="dotnet" arguments=".\myapp1.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
<system.webServer>

Application myapp1 is working normally but when I'm trying to add same thing to myapp2 there is configuration error appears. I even removed handlers section, made it with different name but unfortunately nothing. Is there any documentation or best practice to host two asp.net core apps within one application pool?

I tried running multiple sites sharing same application pool and it worked fine, but then sometimes it behaves strangely so better to have separate application pool.

For example you may encounter following error:

Asp.Net Core HTTP Error 500.0 - ANCM In-Process Handler Load Failure

To avoid such issues create separate application pool for each .NET Core site.

https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/aspnet-core-module?view=aspnetcore-2.2#in-process-hosting-model

Sharing an app pool among apps isn't supported. Use one app pool per app

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