IIS is trying to access the wrong web.config

9

So first a bit of background: I rechecked out my SVN repository to a new location and tried to run the application from there. And now Visual Studio is having problems launching my MVC application using Local IIS Web server. I am currently getting this error:

The requested page cannot be accessed because the related configuration data for the page is invalid.

Detailed Error Information: Module IIS Web Core Notification Unknown Handler Not yet determined Error Code 0x80070003 Config Error Cannot read configuration file Config File \?\C:\RND\app\web.config Requested URL https: //localhost:44304/app Physical Path
Logon Method Not yet determined Logon User Not yet determined Request Tracing Dir

And the problem is that the config file does not exist at c:\RND\app\web.config it is now located at c:\RND\appTest\web.config.

Is there a way I can update this in Visual Studio?

It is as if it has saved the old path somewhere and not automatically updating it.

visual-studio-2010
iis
asked on Stack Overflow Feb 21, 2013 by user1434177 • edited Sep 14, 2017 by meJustAndrew

3 Answers

13

You can correct this behavior by simply deleting the .vs file located in your project, and rebuilding the project. Visual Studio will regenerate another .vs file with the path to the web.config corrected. There are stored the settings about the web.config file path, among the others.

answered on Stack Overflow Jul 12, 2016 by meJustAndrew • edited Oct 29, 2016 by meJustAndrew
6

I had the same issue after moving my project folder. I fixed it by editing the IISExpress applicationhost.config file and correcting the faulty paths found in it.

On my machine the applicationhost.config file was found in C:\Users\\Documents\IISExpress\config

answered on Stack Overflow Jun 27, 2014 by rusvdw
1

I fix it by removing a file named "applicationhost.config" stored in the .vs folder at the same level of .sln file. This file contains all the info about solution, by deleting it visual studio needs to recreate it with the default value.

answered on Stack Overflow Jun 5, 2017 by Paolo

User contributions licensed under CC BY-SA 3.0