-1

Edit: There are other SO answers that say you simply can't do this. One is from back in 2010. That's simply not true. I've been able to run VS as non-admin and debug my web sites. It's only after upgrading to Win 10 that I've had this problem. So the answer from back in 2010, that you can't do it, is simply wrong.

When running my web app within Visual Studio, I'm getting this error:

enter image description here

There are about a thousand suggestions online, and none have worked for me. Well, running VS as administrator works, but I don't want to have to do that. I'd like to know what the problem is, and if there is a solution other than running VS as admin.

Bob Horn
  • 33,387
  • 34
  • 113
  • 219
  • `my web app within Visual Studio` <= do you mean the web app is running in IIS and you are connecting with Visual Studio? Or do you mean you are using IIS Express (the default launch of a web app in VS). – Igor Oct 06 '16 at 13:28
  • The web project properties are set to use Local IIS. I'm not using IIS Express. – Bob Horn Oct 06 '16 at 13:30
  • Possible duplicate: [How can I debug a local IIS service with Visual Studio running as a non-Administrator user?](http://stackoverflow.com/q/3268014/1260204) – Igor Oct 06 '16 at 13:32
  • You need to be an administrator to run IIS on you machine, ego it makes sense that you need to be an administrator to run an application (VS) that connects to IIS. Switch to IIS Express as this is (partly) why it was designed. – LDJ Oct 06 '16 at 13:35
  • @LDJ If that's the case, why can I run as non-admin on Win 7? I'm having this issue now that I've upgraded to Win 10. – Bob Horn Oct 06 '16 at 13:40

1 Answers1

1

Running VS as Admin is a requirement for many things that you may need to do, according to a list published by Microsoft.
It is one of the first things that I make sure of on any new dev machine.

Present in that list:
Debugging applications that a run under a different user account, such as ASP.NET websites.

More info here: https://msdn.microsoft.com/en-us/library/jj662724.aspx

Peter B
  • 22,460
  • 5
  • 32
  • 69
  • So is the answer then that I just can't debug as myself? I have to be admin? – Bob Horn Oct 06 '16 at 13:42
  • You can be yourself, but your account will need Administrator privileges. An alternative could be to create a second account with Admin privileges, and then every time you use your regular account to start DevEnv with the 'Run as Admin' option, you can confirm/allow it using the second account. But you might grow tired of that quite soon... – Peter B Oct 06 '16 at 13:51