Security Exception
Posted: Thu 24 May 2007 18:14
I am getting an error when trying to execute a MySqlScript.Open() from my application. My application runs on one server and the database is on another server. The error I get is as follows:
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.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
Line 134: myScript = New MySqlScript(drop_sqlstr, myConn)
Line 135: Try
Line 136: myConn.Open()
Line 137: myScript.Execute()
Line 138: myConn.Close()
Source File: d:\Customers\user1275616\www\utils\upload_excel.aspx.vb Line: 136
Stack Trace:
[SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Runtime.Serialization.Formatters.Binary.ObjectReader.CheckSecurity(ParseRecord pr) +1644100
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseArray(ParseRecord pr) +847
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(ParseRecord pr) +76
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRecord pr) +64
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadArray(BinaryHeaderEnum binaryHeaderEnum) +1127
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run() +186
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) +183
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) +190
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream) +12
CoreLab.Common.r.a(Stream A_0, String A_1, String A_2, String& A_3) +137
CoreLab.Common.r.a(LicenseContext A_0, Type A_1, String& A_2, Assembly& A_3) +1423
CoreLab.Common.r.a(LicenseContext A_0, Type A_1, String& A_2, Boolean& A_3, String& A_4) +45
CoreLab.Common.r.a(LicenseContext A_0, Type A_1, Boolean A_2) +146
CoreLab.Common.r.a(LicenseContext A_0, Type A_1, Object A_2, Boolean A_3) +1353
CoreLab.MySql.MySqlConnection.Open() +113
LongRunningTask.upload.initDBTable() in d:\Customers\user1275616\www\utils\upload_excel.aspx.vb:136
LongRunningTask.upload.Button1_Click(Object sender, EventArgs e) in d:\Customers\user1275616\www\utils\upload_excel.aspx.vb:74
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6953
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +154
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.upload_excel_aspx.ProcessRequest(HttpContext context) +29
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
I'm trying to collect some information to send to my ISP in order to resolve this issue. Is this a licensing issue or some security issue on the application server? Does anybody have expereince with this type of issue and have some information that I can send to my ISP so they (or I) can fix the problem? For reference, this application runs fine on my development server and accesses the remote MySQL server as expected. SO, this appears to be some issue with deploying the application on my ISP's server.
Thanks,
Gary Betz
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.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
Line 134: myScript = New MySqlScript(drop_sqlstr, myConn)
Line 135: Try
Line 136: myConn.Open()
Line 137: myScript.Execute()
Line 138: myConn.Close()
Source File: d:\Customers\user1275616\www\utils\upload_excel.aspx.vb Line: 136
Stack Trace:
[SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Runtime.Serialization.Formatters.Binary.ObjectReader.CheckSecurity(ParseRecord pr) +1644100
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseArray(ParseRecord pr) +847
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(ParseRecord pr) +76
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRecord pr) +64
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadArray(BinaryHeaderEnum binaryHeaderEnum) +1127
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run() +186
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) +183
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) +190
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream) +12
CoreLab.Common.r.a(Stream A_0, String A_1, String A_2, String& A_3) +137
CoreLab.Common.r.a(LicenseContext A_0, Type A_1, String& A_2, Assembly& A_3) +1423
CoreLab.Common.r.a(LicenseContext A_0, Type A_1, String& A_2, Boolean& A_3, String& A_4) +45
CoreLab.Common.r.a(LicenseContext A_0, Type A_1, Boolean A_2) +146
CoreLab.Common.r.a(LicenseContext A_0, Type A_1, Object A_2, Boolean A_3) +1353
CoreLab.MySql.MySqlConnection.Open() +113
LongRunningTask.upload.initDBTable() in d:\Customers\user1275616\www\utils\upload_excel.aspx.vb:136
LongRunningTask.upload.Button1_Click(Object sender, EventArgs e) in d:\Customers\user1275616\www\utils\upload_excel.aspx.vb:74
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6953
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +154
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.upload_excel_aspx.ProcessRequest(HttpContext context) +29
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
I'm trying to collect some information to send to my ISP in order to resolve this issue. Is this a licensing issue or some security issue on the application server? Does anybody have expereince with this type of issue and have some information that I can send to my ISP so they (or I) can fix the problem? For reference, this application runs fine on my development server and accesses the remote MySQL server as expected. SO, this appears to be some issue with deploying the application on my ISP's server.
Thanks,
Gary Betz