System.Security.SecurityException: Request for the permission of type

Topics: Resolved, Support Request
Jan 20, 2009 at 8:34 PM
The error I receive is below.  I have removed, commented out and added the trust element in the web.config file, but I still get this error.  I have also set every folder on the entire site to read/write.  I edited the site.config file and the sitesecurity.config file.

I am trying to host the dasblog on godaddy.  The first error I encountered (500 error) was resolved by setting IIS7 to classic mode.  After I set it to classic mode I started getting meaningful errors like below as opposed to the 500 error.

I'm stumped, not sure what to do next.  I think it has something to do with the machine.config setup godaddy has on this server.  I have filed a ticket with them.

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=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source Error: 

[No relevant source lines]

Source File: App_Web_gojoq1qk.24.cs    Line: 

Stack Trace: 

[SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]   System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0   System.Security.CodeAccessPermission.Demand() +59   System.Diagnostics.ListenerElementsCollection.GetRuntimeObject() +212   System.Diagnostics.TraceInternal.get_Listeners() +134   System.Diagnostics.TraceInternal.WriteLine(String message, String category) +108   System.Diagnostics.Trace.WriteLine(String message, String category) +4   System.Web.TraceContext.Write(String category, String message, Exception errorInfo, Boolean isWarning, Boolean writeToDiagnostics) +935   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.default_aspx.ProcessRequest(HttpContext context) in App_Web_gojoq1qk.24.cs:0   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
Jan 21, 2009 at 4:47 PM
It turns out on godaddy, maybe everywhere else, you need to make 4 virtual directories. 
1 main directory for your blog...I called mine "blog" and 3 underneith it for the 3 directories that have read/write privilages.  These directories are
1. content
2. logs
3. siteconfig

Make sure that you mark each one of these directories "application root" and "Anonymous Access."

Once you have done these things and made your IIS7 work in classic mode you should be good to go, outside of all of the things that dasblog tells you to do.


you could just use the quick install in godaddy under "your applications" then go to blog and select DasBlog.

Painful or painless depends how you like it.  :)
Jan 21, 2009 at 6:43 PM
Good to hear you solved it.
One more thing, you don't have to run IIS 7 in classic mode, but then you have to use the IIS 7 web.config (which should also be in the webpackage.