Security Exception

Oct 3, 2007 at 12:01 AM
Got everything uploaded to GoDaddy (I know, didn't read this until too late), got the database loaded and connectionStrings updated. Any help is greatly appreciated. Getting the following error:

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.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source Error:


Line 599:
Line 600: If Not System.Web.HttpContext.Current Is Nothing Then
Line 601: item.Save(System.Web.HttpContext.Current.User.Identity.Name)
Line 602: Else
Line 603: item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name)


Source File: d:\hosting\jlasaz\App_Code\DAL\Generated\WebSettings.vb Line: 601

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.WebSettings.Insert(String varName, String varSlogan, String varCopyright, String varAddress, String varSiteURL, String varMailServer, String varMailUsername, String varMailPassword, Boolean varEmailVerification, Boolean varAdminVerification, Int32 varPageSize, Boolean varReportCMS, String varWebmaster, Boolean varIsHighestWinner, Int32 varModerationLevel, Int32 varCurrentSeason) in d:\hosting\jlasaz\App_Code\DAL\Generated\WebSettings.vb:601
ClubStarterKit.Web.Settings.PushToSession() in d:\hosting\jlasaz\App_Code\BLL\Settings.vb:31
ASP.globalasax.SessionStart(Object sender, EventArgs e) in d:\hosting\jlasaz\global.asax:24
System.Web.SessionState.SessionStateModule.RaiseOnStart(EventArgs e) +2211278
System.Web.SessionState.SessionStateModule.CompleteAcquireState() +154
System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +547
System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +90
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832
Coordinator
Oct 3, 2007 at 1:01 AM
Ah... it's a medium trust issue. I haven't seen a fix for it. Anyone fix this?

Sorry this is happening! If I could help, I would :)
Oct 3, 2007 at 5:18 AM
Is there any way to work around this?
Oct 3, 2007 at 4:57 PM
Edited Oct 3, 2007 at 4:59 PM
I have the same issue i'm working on it.
I try to find a solution to configure the starterkit in medium trust level

http://msdn2.microsoft.com/en-us/library/ms998341.aspx
Oct 4, 2007 at 5:00 AM
I was working with a different template and, using godaddy, I had to create the App_Data folder using their web application in order to load things into it that worked. I also saw another post that mentioned creating the directories manually using the host provider web tool. Do you think this might work in this situation?
Oct 4, 2007 at 11:37 PM
I have good news. I have resolved the security exception mentioned above, at least so far. My steps were as follows:

1. Create AppData, AppCode, and App_Theme using godaddy web tool with each directory permissioned at Read, Web, and Write
2. Create new blank db using godaddy web tool
3. Run scripts found in App_Data (with the exception of the schemaversion lines of code) using godaddy web tool query analyzer
4. Update connectionStrings.config with appropriate godaddy strings
5. Upload with VWD FTP
6. Pages will now load without security exception

Things to note:
1. I have not performed a full test, yet
2. All navigation and pages appear to be working thus far, with the exception of Statistics

I will begin testing of components this evening to see what happens.
Oct 8, 2007 at 11:52 PM
Alas, I spoke too soon. Manually creating the folders allowed the site to function partially, but anything that used subsonic errored. Oh well, back to the drawing board.