Microsoft Knowledge Base Email Alertz

(307513) - If an ASP.NET application uses a custom configuration section handler, a first chance access violation may occur in the Aspnet_wp.exe process (or W3wp.exe process, foran application that runs on Microsoft Internet Information Services [IIS] 6.0) when...

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Access violation occurs when you use a custom configuration section handler in an ASP.NET application that is under stress

Article ID: 307513 - View products that this article applies to.
This article was previously published under Q307513
This article refers to the following Microsoft .NET Framework Class Library namespaces:
  • System.Configuration

SYMPTOMS

If an ASP.NET application uses a custom configuration section handler, a first chance exception of type access violation may occur in the Aspnet_wp.exe process (or W3wp.exe process, foran application that runs on Microsoft Internet Information Services [IIS] 6.0) when the ASP.NET application is under stress.

CAUSE

This problem can occur when multiple threads are accessing the same configuration object simultaneously if your implementation of the IConfigurationSectionHandler interface is not thread-safe and stateless or if the object that the Create method returns is not thread-safe and immutable.

RESOLUTION

When you create a custom ASP.NET configuration section handler, use the following guidelines when you implement the IConfigurationSectionHandler interface:
  • Instances of your class that implement the IConfigurationSectionHandler interface must be thread-safe and stateless.
  • The object that the IConfigurationSectionHandler.Create method returns must be thread-safe and immutable.
  • Do not modify the parent argument to the IConfigurationSectionHandler.Create method.

STATUS

This behavior is by design.

MORE INFORMATION

Instances of IConfigurationSectionHandler must be thread-safe and stateless. You must be able to call the IConfigurationSectionHandler.Create method from multiple threads simultaneously.

Furthermore, the configuration object that IConfigurationSectionHandler.Create generates must be thread-safe and immutable. Because the configuration system caches the configuration objects, it is important that you not modify the "parent" argument to IConfigurationSectionHandler.Create. For example, if the return value of IConfigurationSectionHandler.Create is only a small modification of the "parent," you must modify a clone of the "parent," not the original.

REFERENCES

For more information about ASP.NET configuration, click the following article numbers to view the articles in the Microsoft Knowledge Base:
307626 ASP.NET configuration overview
309045 How to create a custom ASP.NET configuration section handler in Visual C# .NET

Properties

Article ID: 307513 - Last Review: July 7, 2006 - Revision: 3.3
APPLIES TO
  • Microsoft ASP.NET 1.1
  • Microsoft ASP.NET 1.0
  • Microsoft .NET Framework 1.1
Keywords: 
kbconfig kbhttphandlers kbhttpruntime kbprb kbreadme KB307513
       

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