Security Exception

Posts   
 
    
salmon
User
Posts: 3
Joined: 18-Apr-2008
# Posted on: 18-Apr-2008 04:47:26   

I have a web application running LLBLGen pro 2.0.0.0 Final and using a "manager template" stuck_out_tongue_winking_eye

The application is working fine on my local dev machine and also one of our server, but after we deployed it to the web hosting company, it throws an error below:

=========================================================

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.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 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.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.] System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0 System.Security.CodeAccessPermission.Demand() +59 System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca) +65


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

LLBLGEN pro is the only third party application that i am using in the project so i am thinking there's something related to it.

To replicate this issue, please just create a single site using VS2005 andLLBLgenpro 2.0, Then copy below two files to the root of the website.

  • web.config

  • web_hostedtrust2.config

Thanks

Dave

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 18-Apr-2008 09:21:45   

Please try to add requiresPermission="false" to the config section declaration.

Next time, please attach the config file instead of pasting it.

salmon
User
Posts: 3
Joined: 18-Apr-2008
# Posted on: 18-Apr-2008 09:50:11   

Walaa wrote:

Please try to add requiresPermission="false" to the config section declaration.

Next time, please attach the config file instead of pasting it.

I have changed the web.config according to your suggestion (please see attached), but then another error occurs.

=========================================================

Server Error in '/Howorth' 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: That assembly does not allow partially trusted callers.

Source Error:

Line 18: rpt_PracticeRoom.DataBind(); Line 19: Line 20: } Line 21: }

Source File: c:\AlphaSalmon\Howorth\Howorth\Home\Home.aspx.cs Line: 20

Stack Trace:

[SecurityException: That assembly does not allow partially trusted callers.] Home.Page_Load(Object sender, EventArgs e) in c:\AlphaSalmon\Howorth\Howorth\Home\Home.aspx.cs:20 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7350 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +213 System.Web.UI.Page.ProcessRequest() +86 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18 System.Web.UI.Page.ProcessRequest(HttpContext context) +49 ASP.home_home_aspx.ProcessRequest(HttpContext context) in App_Web_2tly4pji.0.cs:0 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

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


Cheers Dave

salmon
User
Posts: 3
Joined: 18-Apr-2008
# Posted on: 18-Apr-2008 10:35:31   

Walaa wrote:

Please try to add requiresPermission="false" to the config section declaration.

Next time, please attach the config file instead of pasting it.

Thank you very much walaa. I think it is working now. but instead of "requiresPermission" it should be "requirePermission"

Thanks again sunglasses

Cheers Dave

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 18-Apr-2008 10:46:57   

sorry for the typo flushed

Glad it's working simple_smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39883
Joined: 17-Aug-2003
# Posted on: 18-Apr-2008 16:53:13   

Btw, I've removed the attachments, as they contained username/password info (but as they weren't approved no-one could download them yet), and as the issue is resolved, they're no longer needed.

Frans Bouma | Lead developer LLBLGen Pro