How to host multiple .NET Core apps under same url

后端 未结 6 731
南旧
南旧 2020-12-31 07:21

I am building a few web sites in asp.net core (multiple user interface applications and a web api app). They all work together, utilising the web api. For the purpose of m

6条回答
  •  礼貌的吻别
    2020-12-31 07:23

    I got this working using the advice for Sub-applications here: https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.2#sub-applications.

    Here's the meaty part, in case the link dies:

    To host an ASP.NET Core app as a sub-app under another ASP.NET Core app:

    1.Establish an app pool for the sub-app. Set the .NET CLR Version to No Managed Code because the Core Common Language Runtime (CoreCLR) for .NET Core is booted to host the app in the worker process, not the desktop CLR (.NET CLR).

    2.Add the root site in IIS Manager with the sub-app in a folder under the root site.

    3.Right-click the sub-app folder in IIS Manager and select Convert to Application.

    4.In the Add Application dialog, use the Select button for the Application Pool to assign the app pool that you created for the sub-app. Select OK.

    As a bonus, my main application is legacy Web Forms and my sub-application is exciting new .NET Core functionality.

    Happy days.

提交回复
热议问题