Creating ASP.Net Apps Under Projects

I like to keep all my stuff in one place. If I create a web app using Visual Studio, I want to keep it in my Projects directory, along with all my other code. If all you’re using is the development web server (aka the File System option) when creating web apps, you’re fine. But occasionally, you might need to use IIS (aka the HTTP option). Now, if you create the web app in the default location, which is under c:\inetpub\wwwroot, the permissions will be inherited from the parent folder and all will be well for you.

But you’ll start running into problems if you want to put it under the Projects directory by creating a Virtual Directory in IIS that points to that location. First, you’ll need to enable both Anonymous and Windows Authentication (which you should get be default). Second, you’ll need to explicitly grant read access to the directory to a couple of accounts: IIS_IUSR and Users, which is not so obvious. To do that you need to select the directory containing the app, then right-click, select properties, and choose the Security tab. From there you need to add both these accounts to give them Read access to the directory.

Now, you’ll get the behavior you expect. J

About Tony Sneed

Sr. Software Solutions Architect, Hilti Global Application Software
This entry was posted in Technical. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.