security Exception

Topics: ASP.NET 2.0
Sep 28, 2012 at 12:56 PM

Hi,

We have a site which has a news section developed using blogengine.net. The site is hosted on a shared server. We are not able to upload images via blogengine. See below the error that we are getting while uploading images. The trust level in the configuration file is set to "Medium" but still no luck. Please help.

Error Details :

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.

 

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() +61
   System.IO.Directory.InternalCreateDirectory(String fullPath, String path, DirectorySecurity dirSecurity) +595
   System.IO.Directory.CreateDirectory(String path, DirectorySecurity directorySecurity) +150
   admin_entry.Upload(String virtualFolder, FileUpload control, String fileName) +49
   admin_entry.btnUploadImage_Click(Object sender, EventArgs e) +391
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
   System.Web.UI.Page.ProcessRequest() +80
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
   System.Web.UI.Page.ProcessRequest(HttpContext context) +49
   ASP.admin_pages_add_entry_aspx.ProcessRequest(HttpContext context) +4
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

 


 

Coordinator
Sep 28, 2012 at 3:06 PM

You may not have "write" permission on "app_data" folder where BE is trying to save image.

Sep 29, 2012 at 1:41 PM

Given "Full" access permission to "app_data folder" but still have the same problem.