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.Net.SocketPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source Error:


Line 39:         if (open == false)
Line 40:         {
Line 41:             slaveTcpListener.Start();
Line 42:         }
Line 43:            // slaveTcpListener = new TcpListener(address, port);

Source File: g:\pleskvhosts\onxcontrol.com\httpdocs\modbus_tcp.aspx.cs    Line: 41

Stack Trace:


[SecurityException: Request for the permission of type 'System.Net.SocketPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
   System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) +36
   System.Security.CodeAccessPermission.Demand() +48
   System.Net.Sockets.Socket.Bind(EndPoint localEP) +219
   System.Net.Sockets.TcpListener.Start(Int32 backlog) +156
   System.Net.Sockets.TcpListener.Start() +15
   Default2.Page_Load(Object sender, EventArgs e) in g:\pleskvhosts\onxcontrol.com\httpdocs\modbus_tcp.aspx.cs:41
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6796
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +250
   System.Web.UI.Page.ProcessRequest() +76
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +24
   System.Web.UI.Page.ProcessRequest(HttpContext context) +62
   ASP.modbus_tcp_aspx.ProcessRequest(HttpContext context) in App_Web_ywuawsnk.0.cs:0
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +195
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +50
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +73


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4700.0