Microsoft KB Archive/309326

= BUG: Error When You Load .NET Windows Forms Controls and ActiveX Controls on Same Web Page =

Article ID: 309326

Article Last Modified on 2/23/2007

-

APPLIES TO


 * Microsoft Internet Explorer (Programming) 6.0
 * Microsoft Internet Explorer (Programming) 5.01 SP1
 * Microsoft Internet Explorer 5.5
 * Microsoft .NET Framework 1.1
 * Microsoft .NET Framework 1.0

-



This article was previously published under Q309326



SYMPTOMS
You may encounter a security exception under the following circumstances:
 * You host a .NET control that is globally unique identifier (GUID)-activated on the same dynamic Hypertext Markup Language (DHTML) page as a .NET control that is namespace-activated (that is, a .NET control whose assembly you download from an HTTP server). -and-


 * The GUID-activated control tries to access privileged system resources such as the file system.

This problem occurs most often on Microsoft Windows NT 4.0-based systems. However, this problem may also occur on systems that are running Microsoft Windows 2000 or Microsoft Windows XP.



CAUSE
If the DHTML page lists the namespace-activated control first, the GUID-activated control is hosted in the application domain of the first control. Because this application domain is restricted, you cannot perform client-side operations that are generally considered unsafe for a DHTML page. For example, this restricted domain does not allow you to randomly access the file system or to run unmanaged code.



RESOLUTION
To work around this problem, move the  tag for the GUID-activated control above the  tag for the namespace-activated control. This prevents the GUID-activated control from being hosted in the wrong application domain.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

Additional query words: kbreadme winforms appdomain

Keywords: kbctrl kbbug kbdhtml kbpending kbreadme KB309326

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.