添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Description

Visual Studio throws the exception when adding a ReportViewer control to an .aspx page.

Error Message

The ReportViewer control failed to setup the http handler in the web.config file. 
You may experience troubles when viewing the report.   
Exception details:  This document already has a 'DocumentElement' node.

Cause

This happens when a default namespace is added to the root <configuration> element of the web.config file.

For example:

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

Solution

This doesn’t cause any runtime problems, but in case you try to alter the web.config like we do, it would throw the exception.

To avoid the error, delete the xmlns reference and have the root configuration element look like the following:

<configuration> 

Also, restart Visual Studio. Once you start it back up, we would successfully alter the web.config adding our http handlers for the ReportViewer with no errors.

Notes

Another "side-effect" of having default namespace is missing intellisense for the web.config file.

See Also

VS 2005 Intellisense in web.config files

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.