|
Article relates to
|
Telerik Reporting
|
|
Created by
|
Steve, Telerik
|
|
Last modified
|
09 September, 2009
|
|
Last modified by
|
Steve, Telerik
|
PROBLEM
When trying to show a report in our web ReportViewer control, Visual Studio throws the following exception:
InvalidOperationException: Failed to map the path '/'
SOLUTION
Looking at the stack trace, we notice that the exception is raised by the WebConfigurationManager class and if we try the following:
Configuration cfg = WebConfigurationManager.OpenWebConfiguration(System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath);
in the Page_Load method, it would cause the same error, which obviously excludes the possibility of this being an issue with the web viewer. The error is a peculiar one, because the code is taken straight from the MSDN documentation and the strangest thing is that if you run your web site/app in IIS, it would work as expected. So after some trial and error, the problem got narrowed down to the built-in VS web server Cassini - the problem proved to be not running VS as Administrator. Vista and Win 7 show warning messages when Visual Studio is not being run as administrator, however there is a tick to "silence" this warning. This way if Visual Studio is not set to run as administrator by default or is not started as administrator explicitly through the context menu "Run as Administrator", there are good chances you'll get the Failed to map the path '/'. exception.
Please
Sign In
to rate this article.