Knowledge Base
smartDBforms.NET for ASP.NET 2
 
 
Knowledge Base Forum
Testimonials
It’s really refreshing to use. Looking at codegen products that are way overkill and generate source code that’s not maintainable - your product rocks.


I have demoed several other products also, and none came close to yours. The simplicity, ease of use and user friendliness were impeccable.
William Joshua
Madison County Schools


Thanks to smartDBforms.NET I am able to save lots of time and make even better websites. I am looking forward to use this tool to help me build websites based on databases.
Anton Beerens
www.blauwwit81.nl


We are really impressed with smartDBforms.NET and there is nothing else on the market as good.
Andy Jones
Make I.T. Simple
www.makeitsimple.info
Search knowledge base:

PRB: SecurityException for System.Web.AspNetHostingPermission when using UNC path
Monday, 25 June 2007
The following exception appears when opening the website: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

SYMPTOMS

The following exception appears when opening the website.

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.Web.UI.Util.GetTypeFromAssemblies(ICollection assemblies, String typeName, Boolean ignoreCase) +140

   System.Web.UI.TemplateParser.GetType(String typeName, Boolean ignoreCase, Boolean throwOnError) +295

   System.Web.UI.TemplateParser.ProcessInheritsAttribute(String baseTypeName, String codeFileBaseTypeName, String src, Assembly assembly) +163

   System.Web.UI.TemplateParser.PostProcessMainDirectiveAttributes(IDictionary parseData) +192

 


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

 

 

CAUSE

This problem appears when the website home directory is an UNC path. In this case the code in the website does not have access rights to dynamically load .NET types. For example the method System.Reflection.Assembly.GetType cannot be used in this case. The specific error appears when an .aspx or .ascx page uses the Inherits attribute to change its base class.

 

 

RESOLUTION

You can use one of these methods to resolve the issue

Map the shared folder as a Network Drive

The Home Directory needs to be a directory located on web server computer, not a UNC name ( or a share located
on another comptuer). A workaround is to map the shared folder as a network drive and then use in the form of  Drive Letter:\

Set the shared folder as trusted location

The network share can be granted full trust by using the .NET CASPOL tool or the Microsoft .NET Framework Configuration utility( mscorcfg.msc ).

For more information see:

 


Page Options: format for printing  Format for Printer

Copyright 2006-2010 Adillis Terms Of Use Feedback Contact Us