applicationhost.config bug

Answered

Hello !

Two hours ago I updated Rider IDE to the latest version 2018.1 and now I am getting errors whenever I run the projects, errors occur when Rider is reading applicationhost.config file to run the projects, I solved the problem by coping content of <sites> attribute from vs config to idea config, but Rider replace the content each time it builds the solution and I must replace the content every time. I've been using rider since summer and this is a first time I faced with this problem.

15 comments
Comment actions Permalink

Hello Aleksandr,

A workaround for a bug in generating applicationhost.config:

  1. Copy-paste applicationhost.config from <SolutionFolder>/.vs/config folder to <SolutionFolder>/.idea/config folder.
  2. Go to project properties in Rider, open Web tab and uncheck "Generate applicationhost.config"

Certainly, Rider is supposed to generate valid applicationhost.config files in any case. We would be grateful if you could help us to fix the bug in it. If it is still reproducible, please create a YouTrack issue or a Support Request and attach Visual Studio's and Rider's applicationhost.config files, and the csproj file of the affected project.

Thank you!

4
Comment actions Permalink

I had a similar issue (2018.2), kept getting the message:

"The following site was not found in the configuration file: <project name>"

Looking in the Web tab of the project properties, the Server Type dropdown was set to 'None' when it should have been set to 'IIS Express'. 

Seems like there could an additional check within Rider to prevent this from happening (eg forcing the using to fix the setting when attempting to launch into a debug session with the project selected). Regardless of the setting, Visual Studio was still able to run and debug the project.

Thanks to the comment from Julia - helped solve the issue for me.

4
Comment actions Permalink

Thank you Aaron and Julia - I also had to manually set IIS Express from the Web Project properties to get debugging working. Jetbrains - should this be a seperate ticket where we get either a warning or a more helpful error message when the project properties are set to not set? Or at least add it to the documentation?

(Im using Rider 2018.3)

0
Comment actions Permalink

Thanks. Aaron Scully's solution worked for me.

1
Comment actions Permalink

I'm using Rider 19.3 and VS 2019.

I tried the solution mentioned above but now I get the following error:

"The following site was not found in the configuration file: 'SiteName'"

I also tried copying the file under C:\Users\MyUsername\Documents\IISExpress\config\ but with no luck.

Does someone have a solution for this?

0
Comment actions Permalink

Hello Walter,

I am very sorry to hear you have faced such an issue. For proper investigation, could you please upload applicationhost.config file created by VS and Rider as well as .sln file of the solution with a new issue on our bug tracker. Thank you in advance!

0
Comment actions Permalink

Rider 2019.3 and VS 2019 here too. The proposed solution worked for me.

0
Comment actions Permalink

Rider 2020.1 has same issue. This solution works for me too.

0
Comment actions Permalink

Same here with Rider 2020.1. The workaround works, but it's quite annoying to have to open the solution with Visual Studio, copy the file on every new or cloned project.

I thought this issue has been solved : https://youtrack.jetbrains.com/issue/RIDER-18473

Or the issue in Rider 2020.1 is not related and a new issue should be opened ?

1
Comment actions Permalink

Hi, to solve this issue we used an npm config, we had to combine .NET Project with a Node.js, in this case you don't need to copy files or do an extra work. Just add an npm config with the following script, but you need to have  the nodejs to be installed on your pc.

const httpServer = require("http-server");
const client = httpServer.createServer({
root: "pathToTheClientCodeFolder"
});

client.listen(yourClientAppPortNmber);

when all is done, extra work is not required, all can be run just with one button

0
Comment actions Permalink

As I mentioned it before it would be really helpful if you could upload applicationhost.config file created by VS and Rider as well as .sln file of the solution with a new issue on our bug tracker along with an error message you see. Thank you in advance!

0
Comment actions Permalink

I see this bug is still hanging around after 3 years, its unfortunate. I cannot copy the applicationHost.config from the .vs folder, because there isn't one, and VS quite happy to debug without issue.

3
Comment actions Permalink

Hello
I have to report that I have been facing this problem in JB Rider v2022.1.1 for a few days now after migrating from 2021.3.4. When trying to start my ASP.NET Core 3.1 web API project with the IIS Express launch profile I end up with the error message "The application pool was not found in the configuration file." and the start up fails. VS 2022 can run the launch profile without a problem.

The proposed solution (to replace the applicationhost.config in the .idea folder with the corresponding file from the .vs folder and disable auto-generating the file in the Rider's run configuration) did not work for me. I also tried to delete the .vs and .idea and have the two IDEs generate the folders and files from scratch. No luck. Also retrying the proposed solution for these two re-generated applicationhost.config files did not help. I ran out of ideas how to solve the problem myself. This is a show-stopper for IIS Express launch profile in Rider for me in this project unless I want to fallback to a self-hosted launch profile 

Any idea what else I could try? Thank you very much in advance.

Edit:
Created a YouTrack issue:
https://youtrack.jetbrains.com/issue/RIDER-77592

0

Please sign in to leave a comment.