Error parsing web.config file

  • Thread starter Thread starter Dana
  • Start date Start date
D

Dana

I am re-posting this message after registering my posting alias.

When I specify an end tag for the clear element of namespaces in my
web.config file, the parser error "Unrecognized element 'add'" is reported.

....
<pages>
<namespaces>
<clear></clear>
<add namespace="System"/>
....

When the same element is specified using the empty element tag syntax, it
works.

....
<pages>
<namespaces>
<clear/>
<add namespace="System"/>
....

InstallSheidl/MSI is creating the XML file, and I therefore have no control
over the format details. Is this a known problem? How can I work around it,
short of generating the XML file myself?

Thanks
 
Hi Peabody,

Regarding on the web.config parse error, based on my research, there does
exists an known issue of the ASP.NET web application's configuration file.
When you add <clear> element to remove any collection elements, you need to
use the <clear/> format instead of <clear></clear> syntax. There has some
problems within the configuration parsing code of ASP.NET.

I have also discussed with some other ASP.NET dev engineers, so far the
problem hasn't a fix and the recommend workaround is to change
<clear></clear> syntax to <clear/> so as to avoid the error.

As you mentioned, for your scenario, the elements are generated by
installsheid, then, I'm wondering whether there is any customization point
at the installsheid's setup stage(such as the custom action of windows
installer package) which can let you add some code to do some customization
on the installed application files? Or whether the web.config file can be
created as static content in advance and do not let installsheild to
generate it?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
 
Hi Steven,

Thanks for your reply. Since our installer updates appSettings based on
user input, we can't use a static configuration file. It appears that we'll
need to forego the XML functions in InstallShield/MSI and maintain the file
ourselves. Thanks again for your help.

Dana
 
Thanks for your quick reply Dana,

It is a pity that this is an existing issue which is hard to directly
workaround and I feel sorry for the inconvenience it brings you. If you
have any other ASP.NET dev questions, welcome to post here.

Thanks for your understanding!

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: =?Utf-8?B?RGFuYQ==?= <[email protected]>
References: <[email protected]>
 
Back
Top