System.Security.Permissions.FileIOPermission

Topics: Support Request
May 17, 2008 at 10:35 PM
Still have this problem with medium trust... How do I solve it?


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

Source Error:

[No relevant source lines]

Source File: App_Web_-ukmhdu1.26.cs    Line: 0

Stack Trace:

[SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessPermission.Demand() +59
System.Web.Hosting.HostingEnvironment.MapPath(VirtualPath virtualPath) +76
System.Web.Hosting.HostingEnvironment.MapPath(String virtualPath) +16
newtelligence.DasBlog.Web.Core.SiteUtilities.MapPath(String virtualPath) +72
newtelligence.DasBlog.Web.Core.SharedBasePage.SetupPage(Object o, EventArgs e) +335
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnInit(EventArgs e) +99
System.Web.UI.Page.OnInit(EventArgs e) +9
newtelligence.DasBlog.Web.FormatPage.OnInit(EventArgs e) +4
System.Web.UI.Control.InitRecursive(Control namingContainer) +321
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.formatpage_aspx.ProcessRequest(HttpContext context) in App_Web_-ukmhdu1.26.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
Coordinator
May 20, 2008 at 1:57 AM
Try commenting out all trust references in your Web.config, some hosts have their hosting setup to not allow your Web.config to even attemp to control security level:

<system.web>
  <!-- <trust level="Medium" originUrl=".*" /> -->
    <!-- <trust level="Full" originUrl="" />  -->

    <!--  level="[Full|High|Medium|Low|Minimal]" -->
  <!-- <trust level="High" originUrl=""/>  -->
  <!--  DYNAMIC DEBUG COMPILATION

May 25, 2008 at 3:22 AM
Ok I just uncommented the trustlevel. It did actually run in FullTrust but since my hotel says I cannot use Full Trust I believe that could be the reason I dont catch the daily activity?

I'll post back in a few days to tell wether I get any logs of visits etc. Cheers for the tip
May 25, 2008 at 3:36 AM
Nothing changed, I still don't get the activity report unfortunately. What do I need to do to get Activity-logging working?
Jul 22, 2008 at 6:47 PM
Edited Jul 22, 2008 at 6:53 PM
same problem here in dasblog....

My webhost (Godaddy) supports Medium level trust.


 
when I upload the files and set the application root, im getting error - http://www.kollihills.com/arasiyal.com/ (I didnt set the trust level in the web.config - thinking the its set in the machine level )
 
Later I set the trust level in the webconfig  im getting an error  - check : http://www.kollihills.com/arasiyaltalk.com/ 

Note : Dasbog is already running in the same hosting a/c and its fine.
I hv given full permision (read/write to the root folder and its child folders, but the problem exists)


@catz : did u solve this issue ??
Jul 22, 2008 at 7:20 PM
Well, I did not solve it really.

Most websites have their security level set somewhere above medium meaning you are probably better of setting it to high or taking it away to get rid of the errors. You will be able to get statistics though. Strange thing is this used to work but I guess my hosting provider tweaked their configs.

My blog is now working, I can post, comment, upload and email but I do not get any visitor logs.

Try just removing the part that says trust level and you should be fine :)
Jul 23, 2008 at 2:02 AM

I have  tried that option too, for that also, im getting error.

Its in Godaddy.

----------------------------------------------------------



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 failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SecurityException: Request failed.]
   newtelligence.DasBlog.Web.SiteConfig.GetSiteConfig(String configPath) in SiteConfig.cs:143
   newtelligence.DasBlog.Web.SiteConfig.GetSiteConfig() in SiteConfig.cs:126
   newtelligence.DasBlog.Web.Core.TitleMapperModule.Init(HttpApplication context) in TitleMapperModule.cs:24
   System.Web.HttpApplication.InitModulesCommon() +66
   System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +1006
   System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +259
   System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +114
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +350