Security Exception problem - please help

Topics: Developer Discussion, Help
Oct 3, 2008 at 5:26 PM
I am very new to CSK 2.0.  The discussions indicate that I may have some tough problems.

My site worked great locally, and is up and running on godaddy, but throws security exceptions in (at least) two cases. 

Configuration:
    Express version of the CSK Beta 3.1.  
    Hosted at Godaddy (I can see this may be a bad idea)
    site: http://pcboyscouts.org
    
Case 1: When I try to create news or a new calendar entry from an administrator account, I get:

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:

Line 320:            ' Generates error online.  Suggested fix:  Change item.Save to item.Save("")
Line 321:            If Not System.Web.HttpContext.Current Is Nothing Then
Line 322: item.Save(System.Web.HttpContext.Current.User.Identity.Name)Line 323:            Else
Line 324:                item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name)

Source File: d:\hosting\pcboyscouts\App_Code\DAL\Generated\Announcements.vb    Line: 322

Stack Trace:

[SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   SubSonic.Utilities.Utility.WriteTrace(String message) in Utility.cs:37
   SubSonic.AbstractRecord`1.ValidateColumnSettings() in AbstractRecord.cs:901
   SubSonic.ActiveRecord`1.Validate() in ActiveRecord.cs:354
   SubSonic.ActiveRecord`1.Save(String userName) in ActiveRecord.cs:366
   ClubStarterKit.Data.Announcements.Insert(DateTime varItemdate, String varTitle, String varDescription, String varStaticURL, Int32 varPhoto, Nullable`1 varAlbumid) in d:\hosting\pcboyscouts\App_Code\DAL\Generated\Announcements.vb:322
   ASP.news_add_aspx.GreenRolloverButton3_Click(Object sender, EventArgs e) in d:\hosting\pcboyscouts\news\Add.aspx:49
   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) +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.news_add_aspx.ProcessRequest(HttpContext context) +29
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64


Case 2:  Whe I try to send email from the administrator "Send email" section, I get:

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 64.202.165.58:25

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 64.202.165.58:25

Source Error:

Line 78:         smtp.UseDefaultCredentials = False
Line 79:         smtp.Credentials = a
Line 80: smtp.Send(msgMail)Line 81:         Response.Redirect("~/default.aspx")
Line 82:     End Sub

Source File: d:\hosting\pcboyscouts\Admin\Email.aspx.vb    Line: 80

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 64.202.165.58:25]
   System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +1073657
   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) +217

[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) +1490784
   System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) +191
   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
   Admin_Email.btnSend_Click(Object sender, EventArgs e) in d:\hosting\pcboyscouts\Admin\Email.aspx.vb:80
   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) +1746

Any help would be greatly appreciated.

Oct 8, 2008 at 10:11 PM
I am also have the same issue.  Is there a fix?
Oct 9, 2008 at 4:59 AM
I changed ISPs, which solved the problem right away.  I'm now using re-invent.com.

Good luck!
Nov 22, 2008 at 4:20 AM
hi sprucka,
                 Can you send me the details about how u solve that problem. Did u  changed  your  hosting  company or  taking  a new  internet connection