Mentioned
In
|
 |
 |
 |
 |
Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms
of Use |
Trademarks
Article ID: 823054 - Last Review: October 5, 2005 - Revision: 1.3 System.Configuration.ConfigXmlWhitespace Nodes Are Added in the Custom Sections of the App.config FileOn This PageSYMPTOMSIf you define a custom configuration handler, and then you use the
ConfigurationSettings.GetConfig method to load a custom section from the configuration file of a Microsoft .NET Framework-based application,
the resulting XmlNode may
contain child nodes of type System.Configuration.ConfigXmlWhitespace for each
white space that occurs in the custom section. RESOLUTIONA supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next .NET Framework 1.1 service pack that contains this hotfix. To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site: Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.
The English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
Date Time Version Size File name
--------------------------------------------------------------
17-Sep-2003 22:18 1.1.4322.947 258,048 Aspnet_isapi.dll
17-Sep-2003 22:18 1.1.4322.947 20,480 Aspnet_regiis.exe
17-Sep-2003 22:18 1.1.4322.947 32,768 Aspnet_state.exe
17-Sep-2003 22:18 1.1.4322.947 32,768 Aspnet_wp.exe
15-May-2003 18:49 33,522 InstallPersistSqlState.sql
15-May-2003 18:49 34,150 InstallSqlState.sql
17-Sep-2003 22:09 1.1.4322.947 94,208 PerfCounter.dll
18-Sep-2003 19:43 1.1.4322.947 1,216,512 System.dll
18-Sep-2003 19:40 1.1.4322.947 323,584 System.Runtime.Remoting.dll
18-Sep-2003 19:43 1.1.4322.947 1,253,376 System.Web.dll
18-Sep-2003 19:42 1.1.4322.947 819,200 System.Web.Mobile.dll
18-Sep-2003 19:41 1.1.4322.947 569,344 System.Web.Services.dll
18-Sep-2003 19:44 1.1.4322.947 1,335,296 System.XML.dll
17-Sep-2003 22:13 14,472 WebUIValidation.js STATUSMicrosoft
has confirmed that this is a problem in the Microsoft products that are listed
in the "Applies to" section of this article. MORE INFORMATIONSteps to Reproduce the Behavior- Start Microsoft Visual Studio .NET 2003.
- On the File menu, point to New, and then click Project.
- In the New Project dialog box, click Visual C# Projects under Project Types, and then click Console Application under Templates.
- In the Name text box, replace the default text with MyApplication, and then click OK.
By default, Class1.cs is created.
- Replace the code in Class1.cs with the following code:
using System;
using System.Xml;
using System.Configuration;
namespace MyApplication
{
public class MyConfigHandler : IConfigurationSectionHandler
{
public MyConfigHandler()
{
}
public object Create(object parent, object configContext, XmlNode section)
{
return section;
}
}
class MyClass
{
[STAThread]
static void Main(string[] args)
{
// Get an XmlNode that refers to the custom configuration section.
XmlNode node = (XmlNode) ConfigurationSettings.GetConfig("mySection");
// Process all child nodes.
// Print the "id" attribute, followed by the node type.
foreach (XmlNode child in node.ChildNodes)
{
try
{
Console.Write(child.Attributes["id"].Value);
}
catch
{
Console.Write("?");
}
Console.Write(" ");
Console.WriteLine(child.ToString());
}
}
}
}
- On the Project menu, click Add New Item.
- In the Add New Item - MyApplication dialog box, click XML File under Templates.
- In the Name text box, replace the default text with App.config, and then click Open.
- Replace the code in App.config with the following code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="mySection" type="MyApplication.MyConfigHandler, MyApplication" />
</configSections>
<mySection>
<tag id="0" />
</mySection>
</configuration> - Build the project, and then run the application.
REFERENCES
For additional information about custom configuration sections and handlers, click the following article numbers to view the articles in the Microsoft Knowledge Base:
309045Â
(http://kbalertz.com/Feedback.aspx?kbNumber=309045/
)
HOW TO: Create a Custom ASP.NET Configuration Section Handler in Visual C# .NET
318457Â
(http://kbalertz.com/Feedback.aspx?kbNumber=318457/
)
HOW TO: Create a Custom ASP.NET Configuration Section Handler in Visual Basic .NET
APPLIES TO- Microsoft .NET Framework 1.1
| kbnetframe110sp1fix kbnetframe110presp1fix kbfix kbqfe kbbug KB823054 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate
Be the first to leave feedback, to help others about this knowledge base
article.
(Optional) Name
(Optional)
Public URL Or Email
Comments
No
HTML -- Text Only Please
|
 |
 |
 |
 |
 |
 |
 |
| |