C# Looking for Non-existent Web.Config

0

I am having a strange issue... I am getting this error:

HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid.

Error Code: 0x80070003 (Cannot Read Configuration file)

Config File: \?\E:\TFSLocal\Trunk\loggerTrunk\CommonLogViewer\web.config

Requested URL: http://localhost:80/CommonLogViewer/Search/GetAppModules

Physical Path: E:\TFSLocal\Trunk\loggerTrunk\CommonLogViewer\GetAppModules

It has to do with the path that the app is trying to find the web.config at. I have never had any files at the Physical path that is listed in the error, so I am not sure why it would be trying to look there. The correct path should be:

E:\TFSLocal\MVC Logger\20150723\CommonLogViewer\Search\GetAppModules

I have done searches in the code for a match to that path and also in the IIS and have come up with nothing. Incidentally, the Physical path listed in the IIS is:

E:\TFSLocal\MVC Logger\20150723\CommonLogViewer

Which is the correct path the code files.

Can someone give me a push in the right direction as to how to fix this error?

I have been looking at this for about a day now and haven't come up with a solution as to why it would be looking in a non-existent folder for the web.config.

c#
asp.net
asp.net-mvc
iis-7.5
asked on Stack Overflow Sep 29, 2015 by michaelk46 • edited Sep 29, 2015 by Andy Wiesendanger

2 Answers

2

I ran into this issue and eventually solved it by opening my application host config file and deleting the existing settings.

C:\Users\<USER>\Documents\IISExpress\config\applicationhost.config

I deleted the entire <site name="blah"... </site> for the site I was having a problem with.

answered on Stack Overflow Oct 20, 2015 by Adam H
-1

I did not find a solution, but I found a work around. I noticed that every time I tried to access the search controller, it gave the error, but no where else. So I created a new controller and used that instead of the search controller and everything seems to be going well...

I still don’t have a clue why it tries to search for that web.config in a non-existent file path … but it’s working currently and that is most important...

answered on Stack Overflow Oct 2, 2015 by michaelk46

User contributions licensed under CC BY-SA 3.0