Security exception when passing .net 3.5 to 4.0

1

We have some issues while migrating our Asp.Net Web Application .Net 3.5 to .Net 4.0.

It seemed that we had a Caspol Security Exception, so we added this to our web.config :

<runtime>
  <NetFx40_LegacySecurityPolicy enabled="true"/>
</runtime>

and nothing changed. It seem that we cannot execute the assembly "Microsoft.Web.Management.Iis" in AspNet 4.0. We executed the caspol.exe utility in .Net 4.0 to grant full trust permission with no success.

When we used the local administrator account on the application pools, all work fine. But when we used a domain adminstrator user account, we got this error below :

[PolicyException: Required permissions cannot be acquired.]
       System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +6502926
       System.Security.SecurityManager.ResolveCasPolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) +99

    [FileLoadException: Could not load file or assembly 'Microsoft.Web.Management.Iis, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]

We are running in win2k8 r2 environment with aspnet 2.0 and 4.0 running on the iis 7.5.

Do you have any suggestion to solve our problems.

Thanks

security
iis
.net-4.0
permissions
caspol
asked on Stack Overflow Sep 27, 2011 by Cédric Boivin • edited Sep 27, 2011 by PBelanger

1 Answer

1

We juste make a call support to microsoft to solve the problem.

The problem was because our web site files are hosted on a SAN. There is an hotfix on the framework 4.0 for this issue.

The hotfix is not public at the moment but is name is NDP40-KB2580188-x64.exe

answered on Stack Overflow Sep 28, 2011 by Cédric Boivin

User contributions licensed under CC BY-SA 3.0