asljussar
12-27-2007, 02:12 AM
I am getting this error:
System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
This error is a known issue in Asp.Net 3.5 beta 2.
This is the proposed fix that is documented in:
http://download.microsoft.com/download/d/d/1/dd18043a-fe86-4f57-ac22-791b30e6f04b/dotNetReadme.htm
"2.3.1.5 In ASP.NET, LinqDataSource in medium trust throws System.Security.SecurityException at runtime
In ASP.NET, if an application is run in medium trust, the LinqDataSource control raises the followingruntime exception:
System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
To resolve this issue:
1. Open the web_mediumtrust.config file that is installed in the following location:
%WINDIR%\Microsoft.NET\Framework\v2.0.50727\CONFIG \
2. Make the following two changesin this file
a. Under the <SecurityClasses> element, add a nested entry for a new Security Class. The location where it is entered is not important, as long as it is nested under the <SecurityClasses> element.
<SecurityClasses>
....
<!-- this SecurityClass section is thework around for the compilation issue -->
<SecurityClass
Name="ReflectionPermission"
Description="System.Security.Permissions.ReflectionPermission,
mscorlib,
Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
/>
</SecurityClasses>
b. In the <NamedPermissionSets> section, add a <IPermission> element for reflection permission nested in the ASP.NET <PermissionSet> as shown below:
<NamedPermissionSets>
<PermissionSet
class="NamedPermissionSet"
version="1"
Name="ASP.Net">
...
<!-- this IPermission section is thework around for the reflection issue -->
<IPermission
class="ReflectionPermission"
version="1"
Flags="RestrictedMemberAccess"
/>
</PermissionSet>
...
</NamedPermission>
It does not matter where the <IPermission> section is placed under the ASP.NET permission set element. As long as it is a nested element.
3. Save and close the file."
Could you please upgrade ASP.NET in the IIS7 beta server to the latest release (3.5 RTM) or apply the suggested fix.
Thanks,
System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
This error is a known issue in Asp.Net 3.5 beta 2.
This is the proposed fix that is documented in:
http://download.microsoft.com/download/d/d/1/dd18043a-fe86-4f57-ac22-791b30e6f04b/dotNetReadme.htm
"2.3.1.5 In ASP.NET, LinqDataSource in medium trust throws System.Security.SecurityException at runtime
In ASP.NET, if an application is run in medium trust, the LinqDataSource control raises the followingruntime exception:
System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
To resolve this issue:
1. Open the web_mediumtrust.config file that is installed in the following location:
%WINDIR%\Microsoft.NET\Framework\v2.0.50727\CONFIG \
2. Make the following two changesin this file
a. Under the <SecurityClasses> element, add a nested entry for a new Security Class. The location where it is entered is not important, as long as it is nested under the <SecurityClasses> element.
<SecurityClasses>
....
<!-- this SecurityClass section is thework around for the compilation issue -->
<SecurityClass
Name="ReflectionPermission"
Description="System.Security.Permissions.ReflectionPermission,
mscorlib,
Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
/>
</SecurityClasses>
b. In the <NamedPermissionSets> section, add a <IPermission> element for reflection permission nested in the ASP.NET <PermissionSet> as shown below:
<NamedPermissionSets>
<PermissionSet
class="NamedPermissionSet"
version="1"
Name="ASP.Net">
...
<!-- this IPermission section is thework around for the reflection issue -->
<IPermission
class="ReflectionPermission"
version="1"
Flags="RestrictedMemberAccess"
/>
</PermissionSet>
...
</NamedPermission>
It does not matter where the <IPermission> section is placed under the ASP.NET permission set element. As long as it is a nested element.
3. Save and close the file."
Could you please upgrade ASP.NET in the IIS7 beta server to the latest release (3.5 RTM) or apply the suggested fix.
Thanks,