You receive a "System.Security.SecurityException" message when the LinkLabel property runs in a partially-trusted context (820637)
The information in this article applies to:
- Microsoft Visual Studio 2005 Standard Edition
- Microsoft Visual Studio 2005 Professional Edition
- Microsoft Visual Studio 2005 Express Edition
- Microsoft Visual Studio .NET (2003), Professional Edition
- Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2003), Academic Edition
- Microsoft Visual Studio .NET (2002), Professional Edition
- Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2002), Academic Edition
SYMPTOMSIf you use a LinkLabel control on a localized Windows Form, the application raises the following exception while it tries to deserialize
the LinkArea property during run time: An unhandled
exception of type 'System.Security.SecurityException' occurred in mscorlib.dll.
Additional information: Request for the permission of type
System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.3300.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
Note In Visual Studio 2005, you will receive the following exception: Never enter personal information or passwords into a window unless you can verify and trust the source of the request.
Source: Unknown Site
CAUSEThe application raises the exception because the LinkArea property cannot
be deserialized when the property runs in a partially-trusted context. WORKAROUNDTo work around this problem, set the unrestricted property to True,
so that the property runs in a fully-trusted context, as follows. Microsoft Visual Basic .NET or Microsoft Visual Basic 2005 CodeImports System.Security.Permissions
<Assembly: PermissionSetAttribute(SecurityAction.RequestMinimum, Name:="Internet")>
<Assembly: PermissionSetAttribute(SecurityAction.RequestOptional, Unrestricted:=True)> Microsoft Visual C# or Microsoft Visual C# 2005 Codeusing System.Security.Permissions;
[assembly: PermissionSetAttribute(SecurityAction.RequestMinimum, Name="Internet")]
[assembly: PermissionSetAttribute(SecurityAction.RequestOptional, Unrestricted=true)] STATUS This
behavior is by design.
Modification Type: | Major | Last Reviewed: | 1/27/2006 |
---|
Keywords: | kbvs2005applies kbvs2005swept KbUIDesign kbControl kbWindowsForms kbSecurity kbCtrl kbprb KB820637 kbAudDeveloper |
---|
|