ASP.NET MVC Unable to start debugging on the web server. The web server could not find the requested resource.
04 Mar 2010I was playing around with the project settings of an ASP.NET MVC project to get it working in IIS instead of using the built in Visual Studio web server when I started getting the message shown in the post title above whenever I started the project in debug mode.
After and hour of searching the internet for solution without success I decided to check IIS's Metabase.xml file and found for this particular virtual ASP.NET MVC application the wild card mapping was configured as below:
whereas all over ASP.NET MVC projects had the following configuration:
I am not entirely sure what it was that I did to create the issue but changing the 4 back to a 0 instantly solved the issue.
NB. To do this with IIS 6 running first open IIS manager, right click on the computer name node and select properties and check the Enable Direct Metabase Edit. Be warned; messing up this file could seriously damage the way IIS works so take a backup first. The Metabase.xml file can be found at c:\windows\system32\inetsrv
Update:I found an article which gives the exact reason for the problem I was having. It seems that when the 'flag' is set to '4' it essentially means 'verify that the file exists before passing onto the scripting engine; if it doesn't then return an error'. To fix this in IIS manager simply highlight your wild card entry in the websites Configuration section of the Virtual Directory tab, click on edit and un-check the 'Verify file exists' checkbox.