If you have received the error "Unable to create the Website...To access local IIS Websites, you must run Visual Studio in the context of an administrator account.", you must be running Windows Vista and trying to create a website in the local IIS.
I have been encountering this error often although it is well documented (hard to find?) And time and again, I realize that I need to run Visual Studio under the admin priveleges by elevating it, to create website in the IIS. Hence thought of posting this.
In Windows Vista, by default the applications dont run under the admin priveleges even though you are logged in as an administrator.
To elevate the priveleges, you would require to find Visual Studio from the Start - All Programs - Menu, Right click on the Visual Studio icon and select "Run as administrator", Click "Continue" for the UAC prompt and thereafter you would be able to create websites in the local IIS.
Alternatively, you could also use the built-in cassini webserver to create/host the application in any folder and run it against the ASP.NET Development Server (notice the tiny icon that gets created in your systray) that gets created automatically for running/testing on local machines.
A nice shortcut has been posted by one of our MVPs at http://forums.msdn.microsoft.com/en-US/vsx/thread/501bb098-ccf0-4d6d-933d-dcde58d233e1/ which can be useful to avoid the above steps, everytime.
Cheers !!!
posted @ Sunday, August 24, 2008 9:59 PM