This topic is locked

Security Exception

9/20/2007 3:27:04 AM
ASPRunner.NET General questions
D
Dejan author

I got this error when i try to run my application on internet:

**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.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

  1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
    <%@ Page Language="C#" Debug="true" %>
    or:

  1. Add the following section to the configuration file of your application:
    <configuration>

    <system.web>

    <compilation debug="true"/>

    </system.web>

    </configuration>
    Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
    Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
    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.InteropServices.RuntimeEnvironment.GetCORVersion(StringBuilder sb, Int32 BufferLength, Int32& retLength) +0

    System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion() +67

    ASP.aspnet8_default_aspx.Page_Load(Object sender, EventArgs e) +9

    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15

    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34

    System.Web.UI.Control.OnLoad(EventArgs e) +99

    System.Web.UI.Control.LoadRecursive() +47

    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.aspnet8_default_aspx.ProcessRequest(HttpContext context) +4

    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Ex

    ecute() +154

    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

    **
    Which part of application generated by asprunner.net access to System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089?

D
Dejan author 9/20/2007

also i got :
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

  1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
    <%@ Page Language="C#" Debug="true" %>
    or:

  1. Add the following section to the configuration file of your application:
    <configuration>

    <system.web>

    <compilation debug="true"/>

    </system.web>

    </configuration>
    Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
    Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
    Stack Trace:
    [SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond]

    System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +1002178

    System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +33

    System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +431
    [WebException: Unable to connect to the remote server]

    System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) +1447768

    System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) +190

    System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) +21

    System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +318

    System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) +227

    System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) +316

    System.Net.Mail.SmtpClient.GetConnection() +42

    System.Net.Mail.SmtpClient.Send(MailMessage message) +1485
    [SmtpException: Failure sending mail.]

    System.Net.Mail.SmtpClient.Send(MailMessage message) +2074

    func.SendMail(String mailTo, String subj, String body) +386

    Ctekst_Events.AfterEdit(Page Page) +22

    Ctekst_Edit.tekstSqlDataSource_Updated(Object sender, SqlDataSourceStatusEventArgs e) +131

    System.Web.UI.WebControls.SqlDataSourceView.OnUpdated(SqlDataSourceStatusEventAr

    gs e) +114

    System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +441

    System.Web.UI.WebControls.SqlDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +721

    System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +78

    System.Web.UI.WebControls.DetailsView.HandleUpdate(String commandArg, Boolean causesValidation) +1152

    System.Web.UI.WebControls.DetailsView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +461

    System.Web.UI.WebControls.DetailsView.OnBubbleEvent(Object source, EventArgs e) +95

    System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35

    System.Web.UI.WebControls.DetailsViewRow.OnBubbleEvent(Object source, EventArgs e) +109

    System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35

    System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +115

    System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +163

    System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePo

    stBackEvent(String eventArgument) +7

    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11

    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +174

    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

Eugene 9/20/2007

I got this error when i try to run my application on internet:

[b] 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.


Please, look at this article: http://support.microsoft.com/kb/320268

Probably, it could be useful for you