none
System.Security.Permissions.FileIOPermission RRS feed

  • Question

  • Hi All,

    I have written a windows form application that uses FolderDialog and opens and writes to XML documents.

    It works fine on 2 PC's that I have tried it on, but on one I get the following error.

     

    ************** Exception Text **************

    System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

       at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)

       at System.Security.CodeAccessPermission.Demand()

       at System.IO.Path.GetFullPath(String path)

       at System.Xml.XmlResolver.ResolveUri(Uri baseUri, String relativeUri)

       at System.Xml.XmlUrlResolver.ResolveUri(Uri baseUri, String relativeUri)

       at System.Xml.XmlTextReaderImpl..ctor(String url, XmlNameTable nt)

       at System.Xml.XmlDocument.Load(String filename)

       at MessageConverter.ReplaceWords.FillListBox()

       at MessageConverter.ReplaceWords..ctor()

       at MessageConverter.Converter.optionsToolStripMenuItem_Click(Object sender, EventArgs e)

       at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)

       at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)

       at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)

       at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)

       at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)

       at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)

       at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)

       at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)

       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

       at System.Windows.Forms.Control.WndProc(Message& m)

       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

       at System.Windows.Forms.ToolStrip.WndProc(Message& m)

       at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)

       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    The action that failed was:

    Demand

    The type of the first permission that failed was:

    System.Security.Permissions.FileIOPermission

    The Zone of the assembly that failed was:

    Internet

     

    I have searched around and cannot find anything of much help. I am running it on the local machine, not on a network drive. The other posts I have seen have been trying to run apps on networks but this isn't so I'm not sure what the problem is.

     

    Any help would be much appreciated.

    Thanks in advance.

    Wednesday, March 19, 2008 4:09 PM

Answers