I have a need to host multiple instances of an ASP.NET Core application on a server, which each one being configured differently via a command line argument. The web application instances are managed using a Windows Forms application with the Microsoft.Web.Administration API.
Without using the WinForms app, I was able to get this working with multiple instances by adding arguments with the Configuration Editor for each site in IIS Manager and setting "From" to ApplicationHost.config. This sets a different argument for each app instance to use, all while still running from the same ASP.NET Core .exe.
What I haven't been able to do is translate this to functionality in the WinForms application. When an instance is added via the tool, a new <location>
element is added to ApplicationHost.config, and I need to add an <aspNetCore arguments="xxxx" />
child element to it.