Unable to create the Web site - To access local IIS Websites... Error

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 !!!

Print | posted on Sunday, August 24, 2008 9:59 PM

Comments on this post

# re: Unable to create the Web site - To access local IIS Websites... Error

Requesting Gravatar...
Wow thanks for this great post
Left by SEO Manchester on Aug 26, 2008 7:29 PM

# re: Unable to create the Web site - To access local IIS Websites... Error

Requesting Gravatar...
Thanks for the info. It helped me.
Left by Sam on Oct 12, 2008 5:20 AM

# re: Unable to create the Web site - To access local IIS Websites... Error

Requesting Gravatar...
You are a life saver. I was going nuts trying to figure out what I was doing wrong.
Left by Randy on Mar 30, 2009 7:22 AM

# re: Unable to create the Web site - To access local IIS Websites... Error

Requesting Gravatar...
you save my life thanks
Left by kitty on Jun 27, 2009 12:02 PM

# re: Unable to create the Web site - To access local IIS Websites... Error

Requesting Gravatar...
thanks a lot. it works :)
Left by Tariq Ahmed on Jul 13, 2009 2:36 AM

# re: Unable to create the Web site - To access local IIS Websites... Error

Requesting Gravatar...
very very good!!!
Left by Fernando on Aug 19, 2009 6:28 AM

# re: Unable to create the Web site - To access local IIS Websites... Error

Requesting Gravatar...
Thank you so much for this post!! It was very helpful.
Left by Chris on Sep 15, 2009 3:13 AM

# Right

Requesting Gravatar...
Thank You..
You help me
Left by Ibrahim on Sep 30, 2009 3:19 AM

# re: Unable to create the Web site - To access local IIS Websites... Error

Requesting Gravatar...
I get this error using Windows XP and im the administraitor... this is annoying :( what do i do?
Left by Chris on Oct 04, 2009 2:24 PM

# Unable to create the Web site - To access local IIS Websites... Error

Requesting Gravatar...
Thanks for sharing!
Left by Portable Tap Dance Floors on Oct 12, 2009 6:21 PM

# re: Unable to create the Web site - To access local IIS Websites... Error

Requesting Gravatar...
you are the man
Left by manu on Nov 29, 2009 7:21 PM

# re: Unable to create the Web site - To access local IIS Websites... Error

Requesting Gravatar...
I get this error in windows 2003, and i tried with running as Administrator, but still ends up with the same error, please advice.
Left by Gopi on Jan 01, 2010 2:21 PM

# re: Unable to create the Web site - To access local IIS Websites... Error

Requesting Gravatar...
wow thanks for that shortcut..really a time saver
Left by Budget Van Lines on Jan 20, 2010 9:26 AM

# re: Unable to create the Web site - To access local IIS Websites... Error

Requesting Gravatar...
By default, the applications currently running under the admin rights, even though you are logged in as administrator.
Left by free psn cards on Apr 13, 2010 2:21 PM

# re: Unable to create the Web site - To access local IIS Websites... Error

Requesting Gravatar...
Thanks a lot for this . been struggling for 3 days with this prob.
Left by Matsey on May 11, 2010 5:45 PM

# re: Unable to create the Web site - To access local IIS Websites... Error

Requesting Gravatar...
Thanks a lot. I also have the same problem.
Left by Dheerendra pandey on Oct 29, 2010 6:37 PM

# re: Unable to create the Web site - To access local IIS Websites... Error

Requesting Gravatar...
Great post! Thanks a ton.....
Left by Niladri Sarkar on Nov 02, 2010 8:59 AM

# re: Unable to create the Web site - To access local IIS Websites... Error

Requesting Gravatar...
Although I am running VS as administrator I am gettin the error "You must install the following components", but no components are displayed. I am running VS 2010 on Vista. What could be the issue?
Left by Rajesh Sen on Nov 03, 2010 5:38 PM

# re: Unable to create the Web site - To access local IIS Websites... Error

Requesting Gravatar...
If you have UAC enabled you will need to run the command line with Administrator privileges.

Find the Command Prompt icon, right-click it and choose "Run as Administrator". Then accept the User Account Control prompt
Left by Free Itunes Music on Mar 02, 2011 9:02 AM

# re: Unable to create the Web site - To access local IIS Websites... Error

Requesting Gravatar...
this is really a good info for those who switch from using VS2008 in xp to vista. but how to do you use the inbuilt webserver instaed of IIS here. i mean how will you config the cassini webserver
Left by umamaheshwaran ganesan on Apr 08, 2011 12:02 AM

# re: Unable to create the Web site - To access local IIS Websites... Error

Requesting Gravatar...
thx, for help... just found same problem
Left by VV on Feb 27, 2012 4:01 PM

Your comment:

 (will show your gravatar)