Directory.CreateDirectory() throws FileIOPermission on Ikoula.com host

Last post 05-04-2007 6:37 AM by XiaoYong Dai – MSFT. 5 replies.

Sort Posts:

  • Directory.CreateDirectory() throws FileIOPermission on Ikoula.com host

    04-30-2007, 9:34 AM
    • Loading...
    • Gillardj
    • Joined on 04-30-2007, 1:12 PM
    • Liège, Belgium
    • Posts 3

    Hello,

     

    I've suscribed a MSDN webhosting pack at ikoula.com and i get some troubles creating directories by code. I am trying to use those C# methods:

     

    String p = MapPath("~/Docs/Fichiers/Dossier_test");
    Directory.CreateDirectory(p);

      

    But this System.Security.SecurityException is thrown:

     

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

     The most interesting part of the issue is that I am allowed to create and delete any file in ~/Docs/Fichiers/. I am also allowed to Delete directories but not to create them!

    It seems that a permission has been forgotten by Ikoula. Am I the only one to be faced to this issue? Is there another way to create a directory?

  • Re: Directory.CreateDirectory() throws FileIOPermission on Ikoula.com host

    04-30-2007, 10:31 AM
    • Loading...
    • Javier Luna
    • Joined on 08-29-2006, 4:34 PM
    • Lima, Peru
    • Posts 592
    You would have to setup writting permissions to ASPNET account.
    from Villa El Salvador for world!
  • Re: Directory.CreateDirectory() throws FileIOPermission on Ikoula.com host

    04-30-2007, 10:41 AM
    • Loading...
    • Gillardj
    • Joined on 04-30-2007, 1:12 PM
    • Liège, Belgium
    • Posts 3

    Javier Luna:
    You would have to setup writting permissions to ASPNET account.

    Writing permissions are set, that's why I am able to create/delete files in this directory. I am also allowed to delete a directory.

    For those who are familiar with Plesk (the administration interface of my web account at ikoula.com), Total control is set for this directory, files and sub-directories. But in the specific case of directory creation, this security exception occurs and I dont know why.

    Am I alone in this case? 

  • Re: Directory.CreateDirectory() throws FileIOPermission on Ikoula.com host

    05-02-2007, 11:59 PM
    Answer

    Hi

     'System.Security.Permissions.FileIOPermission" means you should have had unrestricted permissions, please check the security level for your websites and sets it to a unrestricted set of permissions.  To fix it, added this line to Web.Config for the web site:

    <

    trust level="Full" originUrl="" />
    Best Regards
    XiaoYong Dai
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: Directory.CreateDirectory() throws FileIOPermission on Ikoula.com host

    05-03-2007, 10:52 AM
    Answer
    • Loading...
    • Gillardj
    • Joined on 04-30-2007, 1:12 PM
    • Liège, Belgium
    • Posts 3

    Thanks for helping me XiaoYong Yes 

    I would apreciate changing my trust level to Full but I am on a shared host. When I am trying to do so the Configuration Error message is very explicit:

    Parser Error Message: This configuration section cannot be used at this path.  This happens when the site administrator has locked access to this section using <location allowOverride="false"> from an inherited configuration file.

     

    It seems I wont ever override permissions set up by my hoster... Any other testing idea is welcome.

     

  • Re: Directory.CreateDirectory() throws FileIOPermission on Ikoula.com host

    05-04-2007, 6:37 AM

    Hi

    We suggest you'd better contact your ISP for this solution.

    Best Regards
    XiaoYong Dai
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Page 1 of 1 (6 items)
Microsoft Communities
Page view counter