Gaurav Pandey
Gaurav Pandey

Reputation: 2796

Problem: System.Configuration.ConfigurationManager throwing exception

I am having this strange case, at first time when the page loades, everything goes fine. But as soon as I click on any link which makes any ajax request, after that, I get this error while trying to read the configuration.

"System.Configuration.ConfigurationManager.ConnectionStrings' threw an exception of type 'System.Web.HttpException"

I am using asp.net mvc 1.0please refer the attached screenshot Please help. Thanks in advance.

Upvotes: 0

Views: 1031

Answers (2)

Gaurav Pandey
Gaurav Pandey

Reputation: 2796

The problem was coming because of an ajax request which was having one of the route data parameter with space eg. www.domain.com/account/index/%20routedata. In this case, the firebug was showing 404 not found error while as debugging was enabled on the machine, it was throwing the above mentioned exception.

Upvotes: 1

Joakim
Joakim

Reputation: 2217

You need to use WebConfigurationManager and not ConfigurationManager in a web project.

Upvotes: 0

Related Questions