Groups > Web Hosting > IIS Administration and configuration > Re: Request for the permission of type System.Web.AspNetHostingPermission failed




Request for the permission of type
System.Web.AspNetHostingPermission failed

Request for the permission of type System.Web.AspNetHostingPermission failed
Thu, 3 Aug 2006 14:05:07 +0000
I used VS 2005 (ASP.NET 2.0) to build a web application that is residing in IIS
(tried both 5.1 and 6.0)

I have code access security configured for My_Computer_Zone code group to allow
only code that meets Strong Name, Site, URL or GAC membership condition to have
full trust.

When I navigate to my web site using browser I get Server Application
Unavailable error.

There is a warning in the event log followed by 2 error messages.

warning: Failed to initialize the AppDomain:/LM/w3svc/1/ROOT/OctopodDashboard

Exception: System.Security.SecurityException
Message: Request for the permission of type 'System.Web.AspNetHostingPermission,
System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed.
StackTrace:    at System.RuntimeTypeHandle.CreateInstance(RuntimeType type,
Boolean publicOnly, Boolean noCheck, Boolean& canBeCached,
RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
fillCache)
  . . .

error : Failed to execute the request because the ASP.NET process identity does
not have read permissions to the global assembly cache. Error: 0x8013150a

error : aspnet_wp.exe  (PID: 2388) stopped unexpectedly.


The url to my web application is added to the URL membership condition, also my
web app assembly is signed and I did try adding it to the GAC.

The only way to avoid the error is to add all code membership condition with
full trust.  This kind of defeates the use of code access security in my case.

If anyone has encountered this problem and knows a workaround for it (without
giving full trust to all code), please let me know.

Any suggestion is greatly appreciated!!!
Post Reply
Re: Request for the permission of type System.Web.AspNetHostingPermission failed
Thu, 3 Aug 2006 15:40:45 +0000
On IIS 5.1, make sure the local ASPNET account has NTFS read permissions to your
content files and folders.
Post Reply
Re: Request for the permission of type System.Web.AspNetHostingPermission failed
Thu, 3 Aug 2006 23:36:31 +0000
ASPNET definitely has read permissions in IIS 5.1.
Post Reply
Re: Request for the permission of type System.Web.AspNetHostingPermission failed
Fri, 4 Aug 2006 12:59:56 +0000
Read permissions on what exactly?
Post Reply
Re: Request for the permission of type System.Web.AspNetHostingPermission failed
Sat, 5 Aug 2006 11:28:44 +0000
ASPNET account has read permissions on the Web application folder (including
every file and subfolder). I also can confirm that ASPNET has read permissions
to the GAC.

I have found this thread
http://www.velocityreviews.com/forums/t121570-aspnet-process-identity-does-not-h
ave-read-permissions-to-the-global-assembly-cache.html

Will have to try their suggestion and will post the result.
Post Reply
<< Previous 1 2 Next >>
( Page 1 of 2 )
about | contact