djsoteric
djsoteric

Reputation: 316

Rider won't run multiple .NET Framework apps in IIS together if they share a port

Our csproj files for each project look like this:

Project1:

...
<IISUrl>localhost:xyz/</IISUrl>
...

Project2:

...
<IISUrl>localhost:xyz/Playground</IISUrl>
...

In Visual Studio, this just works.

It registers the two projects under the same "Site" as different "Applications" Within IISExpress. Routing just works naturally as you'd expect.

In Rider, when you try to run the projects either one after the other or as part of a multi-launch project, both apps will run but only Project 1 will be registered in IIS. Project 2 presents a "Failed to register URL" error: "Cannot create a file that already exists." because it's trying to create a whole new site with the same root URL that Project 1 uses. Then, it tries to register a second site with the proper path, yet it gets an "Access is denied" error.

The end result is that only Project 1 is registered and working as expected.

Edit: I noticed that VS generates an applicationHost.config xml file that properly puts the two together in one Site while Rider generates its own applicationHost.config that breaks them out. I overwrote the incorrect one, but Rider just overwrites it back to the same nonsense. It

Edit 2: I copied the Visual Studio-generated config once more and then found an option to disable applicationhost.config in each csproj. It is now working, but I'll leave this open in case there's an answer that doesn't depend on VS.

Edit 3: This was reported to JetBrains before the question was asked, but I do not see any traction on the question that was posted about this over 10 years ago and do not expect them to provide an update today.

Upvotes: 0

Views: 60

Answers (0)

Related Questions