When ever you have admin rights to your computer, be sure to run Visual Studio as Administrator. This will greatly reduce the number of headaches cause by tools who don’t react the way you expect them to.
Visual Studio is quirky when it comes to user rights. In some cases, it will misbehave and you might not notice it. One example of this can be observed when you are working with Coded UI Tests (CUIT), when Visual Studio is not running as Administrator, the recorder will not have access to all the control properties that are required. This can quickly lead you to think that the tool isn’t worth much!
Another instance where Visual Studio must be running as Administrator, is when you need to create a website under IIS from within Visual Studio. When it isn’t running under Administrator privileges, it will block you and warn you that you need elevated privileges. This is one of the rare instances where Visual Studio explicitly tells you that you that you are required to start it as an Administrator. This is because IIS requires elevated privileges.
These are but two examples of why it is so important to run Visual Studio as an Administrator.
The image to the right, shows
how to set
Visual Studio to always start as Administrator. Right click on the shortcut and go into the advanced… menu. Then be sure to check the Run as administrator check box.
Remember, when ever you have the possibility, it’s best run Visual Studio with full admin rights.
Pretty stupid advice. Why would you want to run any user application as administrator? Just because running as admin is required in your situation doesn’t make it required in others. In almost all situations I explicitly do not want to run as admin to get exceptions for security related issues.
Is it pretty obvious that you need to run visual studio as administrator when that instance requires administrative access to do non user stuff like your example of IIS. But in almost all situations you do not use IIS to develop web applications and only use IIS to test your deployment.
So IMHO I think this is bad advice!
‘But in almost all situations you do not use IIS to develop web applications and only use IIS to test your deployment’
Not quite true in my experience. A serious application would be having application pool, possibly ADFS or similar certificates based authentication and so on that might need a specific site name. The is specially true when you have the application already in the PROD. IISExpress would not suffice unless someone proves me wrong.
Having to use admin user might be a different debate.
Want to update Nuget? You also need administrator rights. I think the issue isn’t about running as Administrator but why Microsoft didn’t say that Coded UI Tests require Admin. Why updating Nuget requires admin… etc…
In any scenario, Visual Studio doesn’t prompt for elevation when you need it. So in any case, I will always run it as administrator. Mainly because it causes more trouble not to run it as administrator than it does running it without admin rights.
I trust Visual Studio, ReSharper and all Microsoft extensions that I have. I don’t think they will take over my machine. So admin it is.
The toughest thing here is you need admin rights to change pretty serious things. Of the answers I’ve seen on StackOverflow, SuperUser etc, they all come down to trust.
But for the context of this, I’ll go through my arguments on why you shouldn’t do this.
Okay, it sounds good. If a 3rd party provider (payment service, hotels etc) updated their API, would you want to know about it? I think its a good thing here, as it can introduce a breaking change and the other 300 people in your development team who depend on your API now have to update theirs too. Note I like this advice from a “be careful here – something might break”.
For IIS development, you need to start it initially to get the IIS metadata installed and running. Apart from that … nothing needs to change? You might be thinking, “Whoa – I need it because it can’t connect to IIS in user mode!?” … trying running IIS as your user – problem solved. Its development after all.
My concerns come down to these things:
Granting local admin rights gives free rein to install absolutely anything
If you work for a company that needs to monitor its software licensing and someones installed Sublime 3, UltraEdit, TextPad, Notepad++, EditPad, which of these require commercial licenses? Who has the license? Where? I’ve worked somewhere where someone installed Firefox from the “Ad” section of Google. Boom – trojans, malware infections galore. File shares broken and bitcoin miners running as Local System.
The masses shouldn’t pay the price for the few, but hey – you’ll feel the pain of every file on shares being encrypted by a virus.
Local admin rights become the norm
With local admin, after months of it, you become desensitised to your privileges.
And then multiply by 300 developers …
So although I agree that some items are necessary with VS admin mode, which are mitigated through training, do you really need it as a preferred default, when you can just tweak a few settings to solve 80% of the systems and put up with the warnings as and when required.
If your working on a personal throw away project on your own machine I’d agree, but for commercial / enterprise environment, it just isn’t feasible.
Since this post was written, the Azure teams at Microsoft have released an Express version of the Emulator which does not require elevated privileges.
I agree without the proper culture the situation you describe.It can get out of hand.