Re: how does the app_data folder work

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



re:
!> is app_data a reserved name for IIS and ASP.Net

No, it's not.

The files which are not served are set in the master web.config file, in the
<httpHandlers> section, managed by System.Web.HttpForbiddenHandler.

That m,aster web.config file is located at :
drive:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config

Examples :

<add path="*.mdb" verb="*" type="System.Web.HttpForbiddenHandler" validate="True" />
<add path="*.ldb" verb="*" type="System.Web.HttpForbiddenHandler" validate="True" />
<add path="*.mdf" verb="*" type="System.Web.HttpForbiddenHandler" validate="True" />
<add path="*.ldf" verb="*" type="System.Web.HttpForbiddenHandler" validate="True" />

You can add any other file extensions you don't want
ASP.NET to serve directly by following that format.

re:
!> is there some jiggery pokery going on behind the scenes with file permissions or virtual roots?

There's also some jiggery pokery going on behind the scenes with file permissions or virtual roots.

If you create a Web site in Visual Web Developer (whether the standalone or the VS IDE),
VWD creates a folder named App_Data below the current root folder.

The folder is designed to be a store for application data of any type.

The App_Data folder is also used by ASP.NET to store databases that the system maintains,
such as the database for membership and roles.

When VWD creates the App_Data folder, it grants Read and Write permissions
for the folder to the ASPNET or NETWORK SERVICE user account.

So, if a request is made from an external browser for a forbidden file,
the account requesting it won't be the ASPNET or NETWORK SERVICE accounts,
which are the only ones which are allowed access to those files.

There's no "unexplained magic" involved.
It's all pretty much straightforward.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Andy Fish" <ajfish@xxxxxxxxxxxxxxxx> wrote in message news:uKpdqy78HHA.980@xxxxxxxxxxxxxxxxxxxxxxx
Hi,

From what I can gather, under Asp.Net 2.0, it is safe to put data and config files underneath the app_data in the web
root and they will not be served directly to the browser from a URL.

Can anyone explain just how this feature works. is app_data a reserved name for IIS and ASP.Net, or is there some
jiggery pokery going on behind the scenes with file permissions or virtual roots?

It's not that I don't trust Microsoft; it's just that .... well.... I guess I don't trust Microsoft - especially where
bits of unexplained magic are concerned :-)

TIA

Andy




.



Relevant Pages

  • Re: how does the app_data folder work
    ... visual web developer) with a one folder called foo and one called app_data ... http://localhost/mysite/app_data/foo.bar even though the file permissions ... is app_data a reserved name for IIS and ASP.Net ... permissions or virtual roots? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: how does the app_data folder work
    ... so surely there must be some magic going on behind the scenes somewhere? ... in the App_Data folder will be protected by default. ... There's also some jiggery pokery going on behind the scenes with file permissions or virtual roots. ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: c1030af7 on SBS2003, after installing ProjectServer 2003 and all u
    ... Thank you for posting in SBS newsgroup. ... If no other virtual folders exist in IIS, the best way should be restoring ... In IIS, select Web Sites, and note the "Identifier" for Default Web Site ... | folder insted of the /projectserver folder work anymore. ...
    (microsoft.public.windows.server.sbs)
  • Re: Manually Created Web Site Does Not Work - What am I Missing?
    ... between my VS project - and therefore assembly names - and the IIS Web site. ... have the same name or folder structure as my VS project. ... The ASP.NET Dev Server runs as the Administrator account in VS 2008. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Help with Interactions between IISadmin mmc and FP2003
    ... and all the main things with IIS, FP2003, ... Site Server Architecture currently in use, ... depending on whether one uses IIS Admin or FP. ... plain vanilla folder, vanilla with little globe in lower ...
    (microsoft.public.frontpage.client)