I want to run two projects on an IIS Express server using JetBrains Rider.
I've tried using a compound configuration, but I can't find a way to run two projects on the same server? Is that even possible in Rider? In Visual Studio it works, how does Visual studio do this?
Is there any changes I can make to my local .idea applicationhost.config to fix it?
Thanks!
It definitely is possible to run multiple ASP.NET Core IIS Express projects in JetBrains Rider simultaneously. There's a known issue that it requires some additional/manual settings: RIDER-32933. There's a workaround explained in the comments which I'll briefly duplicate here.
IIS Express natively supports running multiple sites using the same configuration file, and Rider uses this ability to some extent. The only issue is that it overwrites IIS config on starting each application, which leads IIS Express to kill any previously started application instance.
From your question, I conclude that you've already created the appropriate run configurations for your apps, so I won't explain it here (but here's a link to the corresponding documentation if you need help).
So, first, you'll need to make Rider to create a proper applicationhost.config
for you. To do that, run every configuration you want to run simultaneously at least once. E.g. if you have two apps, "WebApplication1: IIS Express" and "WebApplication13: IIS Express", you'll need to start each of them once.
After you've done that, Rider will generate an appropriate configuration file in .idea/config/applicationhost.config
in your solution folder. Important section is:
<sites>
[…]
<site name="WebApplication" id="1">
[…]
<bindings>
<binding protocol="http" bindingInformation="*:49901:localhost" />
<binding protocol="https" bindingInformation="*:44375:localhost" />
</bindings>
</site>
<site name="WebApplication13" id="2">
[…]
<bindings>
<binding protocol="http" bindingInformation="*:26835:localhost" />
<binding protocol="https" bindingInformation="*:44339:localhost" />
</bindings>
</site>
</sites>
So, after you have both of your sites in this config, you'll need to disallow Rider to touch the config. Do that by opening the run configuration settings for both of your configurations and unticking of the Generate applicationhost.config checkbox:
After that, you may either start both of your configurations manually (by selecting each one and pressing the Run button), or using a compound configuration. Debug will work, too.