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

  • Question

  • User1626252724 posted

    Hi Friends,

    i am having a problem in coping file from my local machine to website through source code . by using

    File.Copy(DPath, savePath, true);

    that code generating

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

    Wednesday, May 7, 2008 1:22 AM

Answers

  • User300685930 posted

    you need to have the aspnet user have permission to write to the location on your hard disk you want.  go into Properties / Security settings on file folder and make it writeable.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 8, 2008 10:53 AM

All replies

  • User300685930 posted

    you need to have the aspnet user have permission to write to the location on your hard disk you want.  go into Properties / Security settings on file folder and make it writeable.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 8, 2008 10:53 AM
  • User1923880652 posted
    You shoud give full permission to aspnet user [some time also NetworkService user] for the DPath and savepath root folder
    Friday, May 9, 2008 6:09 AM
  • User765854956 posted

    I also have same issue.

     when i am testing my work on local machine getting error "Could not load file or assembly 'System.Data.DataSetExtensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies"

    while on web server it works.

     Any help please!!!!

    Tuesday, May 13, 2008 5:01 PM
  • User765854956 posted

    Thank you very much Shahid

    Thursday, May 15, 2008 11:52 AM
  • User1923880652 posted

    Ashok if post help u then please mark it as answer

    Thanks 

    Thursday, May 15, 2008 12:03 PM
  • User1705226643 posted

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

    This is what error i m getting. I am trying to upload file and above msg i got .

     

    How i can upload file i m using VB.net. Please provide me where to make change in web.config and what? I dnt know about it.

     

    Thanks in advance.

    ajit 


    Monday, September 1, 2008 3:19 AM
  • User1321262869 posted

    Here is a easy solution

    <system.web>
            <trust  level="Full"/>

    Wednesday, February 3, 2010 5:55 AM
  • User892025786 posted

    hi sir,

    i am uploading  a .mdb file on app_data folder using file uploader ,that hosted the page in server trying to do this but getting System.security.Permissions ... error can you please help me in assigning permisssions to aspnet user and how to create it ,will you please make it brief for me as i am new to this concept.

    thanks in advance...

    Srinivas M

    Thursday, July 14, 2011 6:12 AM