web.config access problem

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default web.config access problem

    I'm trying to set up an application so that on first run/install it writes
    to the web.config various values.

    I have loaded the web.config into an xmldocument and have made the changes
    but can't save the file back to disc i get an error similar to the
    following:

    Access to the path "C:\Source\myApp\web.config" is denied.

    The web application is not in the inetpub folder.

    How do i set the security/access etc so that the web.config file can be
    written to.

    The error page says:

    "To grant ASP.NET write access to a file, right-click the file in Explorer,
    choose "Properties" and select the Security tab. Click "Add" to add the
    appropriate user or group. Highlight the ASP.NET account, and check the
    boxes for the desired access."

    I'm using windows xp pro and this option is not available where i can see
    it.

    I ideally would like to be able to do any settings at runtime in code but if
    not possible any other suggested method would be appreciated.

    barney nicholls



    Microsoft Guest

  2. Similar Questions and Discussions

    1. Write access to web.config
      What are the security risks to grant ASP.NET user write access to web.config? I am working on a project in which I am required to update web.config...
    2. Please help with iis/asp.net config for anonymous access.
      Is this a virtual directory on a network share? Have you supplied the correct crendentials when setting up the virtual directory? If this is not on...
    3. access to web.config at design time
      Is there any way to get appication settings from web.config file at design time? Is it possible in principal? Both: n= new...
    4. Problem with web.config access-restricted subdirectory
      Hi, I have a problem with web.config unsuccessfully controlling access to a subdirectory. I'm using VS03 and IIS5.0 on NT2K. I have been able...
    5. Access to config file
      I'm writing C# ASP.NET application. For different parts of application I wrote different config files. When I was transferred files from my office...
  3. #2

    Default Re: web.config access problem

    Mary

    I've created other folders and text files etc and i still can't get write
    access to them.

    I think i've iis5 up correctly but i must be a bit dim as i just can't get
    it to let me write to a file.

    any pointers on setting write access for asp.net to a file in a directory
    with iis 5 and xp pro would be appreciated

    "Mary Chipman" <mchip@nomail.please> wrote in message
    news:2g3clv09u1qr77vpfj8oljipd0fvi19sb6@4ax.com...
    > Web.config is designed so that it can't be browsed to or written to at
    > runtime. You'll need to modify it outside of ASP.NET.
    >
    > -- Mary
    > MCW Technologies
    > [url]http://www.mcwtech.com[/url]
    >
    > On Wed, 3 Sep 2003 14:12:36 +0100, "Microsoft"
    > <barney.nicholls@code247nospam.com> wrote:
    >
    > >I'm trying to set up an application so that on first run/install it
    writes
    > >to the web.config various values.
    > >
    > >I have loaded the web.config into an xmldocument and have made the
    changes
    > >but can't save the file back to disc i get an error similar to the
    > >following:
    > >
    > >Access to the path "C:\Source\myApp\web.config" is denied.
    > >
    > >The web application is not in the inetpub folder.
    > >
    > >How do i set the security/access etc so that the web.config file can be
    > >written to.
    > >
    > >The error page says:
    > >
    > >"To grant ASP.NET write access to a file, right-click the file in
    Explorer,
    > >choose "Properties" and select the Security tab. Click "Add" to add the
    > >appropriate user or group. Highlight the ASP.NET account, and check the
    > >boxes for the desired access."
    > >
    > >I'm using windows xp pro and this option is not available where i can see
    > >it.
    > >
    > >I ideally would like to be able to do any settings at runtime in code but
    if
    > >not possible any other suggested method would be appreciated.
    > >
    > >barney nicholls
    > >
    > >
    >

    Barney Nicholls Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139