Worked in localhost, creating problem in server!!

Last post 05-31-2006, 11:56 AM by Adam. 1 replies.
Sort Posts: Previous Next
  •  05-31-2006, 10:22 AM 19663

    Worked in localhost, creating problem in server!!

    Hi,
     
    My application has worked in the localhost but when i uploaded it and trying to read a file into editor its posing an exception like.
     
    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:

    Line 43:     public static string LoadContentFromFile(string pFileName)
    Line 44:     {
    Line 45:         StreamReader sReader = new StreamReader(pFileName);
    Line 46:         string vTempString = sReader.ReadToEnd();
    Line 47:         sReader.Close();
     
    Source File: d:\Hosting\cybersofttech\CmsEditor\EditFiles.aspx.cs    Line: 45
    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.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) +678
       System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) +115
       System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) +85
       System.IO.StreamReader..ctor(String path) +112
       EditFiles.LoadContentFromFile(String pFileName) in d:\Hosting\cybersofttech\CmsEditor\EditFiles.aspx.cs:45
       EditFiles.Page_Load(Object sender, EventArgs e) in d:\Hosting\cybersofttech\CmsEditor\EditFiles.aspx.cs:37
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
       System.Web.UI.Control.OnLoad(EventArgs e) +99
       System.Web.UI.Control.LoadRecursive() +47
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6953
       System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +154
       System.Web.UI.Page.ProcessRequest() +86
       System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
       System.Web.UI.Page.ProcessRequest(HttpContext context) +49
       ASP.editfiles_aspx.ProcessRequest(HttpContext context) in App_Web_jthdvfct.4.cs:0
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
     
    There is no problem with my previous appns where i did same thing and accessed the folder by creating another virtual directory and setting the permissions to the folder.But it doesnot work here . annoying!
     
    Is it a problem with editor because i checked all the things .
     
    thanks for ur reply
     
  •  05-31-2006, 11:56 AM 19673 in reply to 19663

    Re: Worked in localhost, creating problem in server!!

    navin,
     
    Please try create a new virtual directory and upload the simple aspx which only contains the editor control. Then try agian.
     
    If the problem still exists, please send the URL to me.
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML