IIS7 64-bit - Full Trust Level problem

I have the following setup: 1 blade server (W2008R2) with multiple VM's (Hyper-V) on that blade. One VM is configured with IIS7 and the Document Root is on a UNC Network Drive.

The website we're testing is compiled in ASP.NET 3.5 and VS2008 (Any CPU) and published to the shared UNC Network Drive (same as the IIS7 Document Root)

One problem has been persistent and unresolved so far: the fact that the Document Root is on a network drive, the web.config requires Full Trust level which we configured as follows:
<system.web>
    <trust level="Full" originUrl=""/>
</system.web>

and on IIS - Features View - .NET Trust Levels is set to "Full (internal)" from the drop down.

The Application Pool - Identity was changed to "LocalSystem".

This configuration procuces the following error (with the complete stack trace posted below this question):

Security Exception
Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Server Error in '/' Application. 


Security Exception 
Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. 

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace: 

[SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   System.Reflection.Assembly._GetType(String name, Boolean throwOnError, Boolean ignoreCase) +0
   System.Reflection.Assembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase) +42
   System.Web.UI.Util.GetTypeFromAssemblies(ICollection assemblies, String typeName, Boolean ignoreCase) +145
   System.Web.UI.TemplateParser.GetType(String typeName, Boolean ignoreCase, Boolean throwOnError) +73
   System.Web.UI.TemplateParser.ProcessInheritsAttribute(String baseTypeName, String codeFileBaseTypeName, String src, Assembly assembly) +111
   System.Web.UI.TemplateParser.PostProcessMainDirectiveAttributes(IDictionary parseData) +279




Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927

Open in new window

conrad2010Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Syed Mutahir AliTechnology ConsultantCommented:
http://dbvt.com/blog/post/AspNetHostingPermission-Security-Exception-Fix-with-Ajax-in-IIS7.aspx

http://www.pixelmill.com/support/support_article.aspx?ParentListID=al1009&articleid=kb101831

Check the two links - Not an IIS Guru or ASP for the matter - just came across your question and trying to help.

Kind Regards
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
conrad2010Author Commented:
@mutahir:

thanks for adding the links... I forgot to mention in my question but this setting was already added:

Application Pool - Advanced Settings - Load User Profile - True

Application Pool - Advanced Settings - Enable 32-Bit Applications - True

Also tried the following command line setting (but without success):
caspol.exe -m -ag 1 -url "file:////\\(server)\(sharename)\*" FullTrust -exclusive on
0
Syed Mutahir AliTechnology ConsultantCommented:
Conrad2010,

Thanks for the points - what was the final solution to your problem ? will help me in the future too :-)

0
conrad2010Author Commented:
caspol.exe -m -ag 1 -url "file:////\\(server)\(sharename)\*" FullTrust -exclusive on

that worked, after restarting IIS
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Virtual Server

From novice to tech pro — start learning today.