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

Source Error:


Line 49:         appendText += Environment.NewLine;
Line 50:         appendText += "--------------------------------------------------------------------------------------------------------------" + Environment.NewLine + Environment.NewLine + Environment.NewLine;
Line 51:         File.AppendAllText(path, appendText, Encoding.UTF8);
Line 52:     }
Line 53: }

Source File: d:\webroot\ilsiar khafizova-1133182\archive.bsec-urta.org\wwwroot\error.aspx.cs    Line: 51

Stack Trace:


[SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
   System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) +36
   System.Security.CodeAccessPermission.Demand() +48
   System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, AccessControlActions control, String[] fullPathList, Boolean checkForDuplicates, Boolean needFullPath) +88
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +1335
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +68
   System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost) +76
   System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost) +75
   System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding) +25
   System.IO.File.InternalAppendAllText(String path, String contents, Encoding encoding) +56
   System.IO.File.AppendAllText(String path, String contents, Encoding encoding) +41
   error.Page_Load(Object sender, EventArgs e) in d:\webroot\ilsiar khafizova-1133182\archive.bsec-urta.org\wwwroot\error.aspx.cs:51
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6796
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +250
   System.Web.UI.Page.ProcessRequest() +76
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +24
   System.Web.UI.Page.ProcessRequest(HttpContext context) +62
   ASP.error_aspx.ProcessRequest(HttpContext context) in App_Web_mcd2dx30.0.cs:0
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +195
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +50
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +73


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4110.0