ReportViewer Control: System.InvalidOperationException: Failed to map the path '/'.

Submitted by Robert MacLean on Fri, 11/02/2007 - 11:39

I had an odd issue with trying to get the reportviewer control to work on some ASP.NET pages. I was using VS 2008 beta (but it was a 3.0 project so it should be the same as what you get in VS 2005), and running the solution through the VS web server. When going to the pages (which used local reports) I got the error:

Server Error in '/ATL' Application.
--------------------------------------------------------------------------------

Failed to map the path '/'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Failed to map the path '/'.

No idea what caused it but the moment I changed to run it on IIS it stopped. I did get an error on IIS about reporting services not being able to access the web.config file which was fixed by giving Network Service access to it, that didn't do any difference with VS 2008 web server but it did mean the reports worked. I suspect that it has to do with the way that reporting services locates the web.config file as VS 2008 server runs it as http://localhost:<random port>/<project name>/ where IIS runs it as http://localhost:<random port>.