PRB: Security Exception When You Use Event Handlers in Internet Explorer (316510)
The information in this article applies to:
- Microsoft Internet Explorer (Programming) 5.5
- Microsoft Internet Explorer (Programming) 6.0
- Microsoft .NET Framework 1.1
- Microsoft .NET Framework 1.0
This article was previously published under Q316510 SYMPTOMS You may receive a SecurityException error under the following circumstances:
- You use a custom .NET Windows Forms control that exposes
managed events to Internet Explorer through ActiveX sourcing.
- You use a Web page that consumes the control and handles
events.
- You use the following code to enable security on the
control:
caspol -s on
Note: The control works as expected if you use the following code to
disable security:
caspol -s off
RESOLUTION On any client system, use the .NET Framework Configuration
tool (Mscorcfg.msc) to grant the required, individual permissions to the
assembly. Create a permission set with the following minimum
settings:
- Security:
- Enable assembly execution for permission for the code
to run. Without this permission, managed code cannot run.
- Allow calls to unmanaged assemblies. Because unmanaged
code potentially permits other permissions to be bypassed, this is a dangerous
permission that must only be granted to highly trusted code. It is used for
such applications as calling native code using Platform Invokation Services (PInvoke) or using COM Interop.
- User Interface:
- Allow permission to use windows that are limited to
safe, top-level windows or safe subwindows.
- Web Access:
- Grant the assemblies access to connect with resources.
Give the URL to the assembly.
You can associate a permission set with your control if you
define a code group that keys off evidence that is specific to your control,
such as its strong name. To create a new code group, follow these steps:
- In the .NET Framework Configuration dialog box, click the Code Groups node under the Enterprise node, the Machine node, or the User policy.
- Right-click the All_Code node, and then click New.
For more information about permission sets and code groups, see
the "References" section. STATUSMicrosoft has confirmed that this is a bug in the Microsoft
products that are listed at the beginning of this article.
REFERENCES For
additional information, click the following article number to view the article
in the Microsoft Knowledge Base: 313891
HOW TO: Sink Managed C# Events in Internet Explorer Script
For more information, visit the following Microsoft
Web sites:
Modification Type: | Minor | Last Reviewed: | 7/8/2005 |
---|
Keywords: | kbBug kbSecurity kbCtrl kbEvent kbpending KB316510 kbAudDeveloper |
---|
|