5

I know there are a few topics similar to this but none have my main issue in mind. I don't want to run Visual Studio 2017 as Administrator. Why should we be forced to run it this way? In doing so you lose a few abilities:

  • ability to simply drag files to the solution explorer to add them to your project.
  • Cleanly stopping a debugging session by closing IE or stopping the debugging within VS (and it will close IE for you).
  • There may be others

For posterity the error is:

Unable to start debugging on the web server. IIS does not list a web site that matches the launched URL.

I have already followed the advice thusly:

  1. Start >> Control Panel >> Click Programs
  2. Click Turn Windows features on or off.
  3. In the User Account Control dialog box, click Continue
  4. Expand Internet Information Services, expand Web Management Tools, and then expand IIS 6 Management Compatibility
  5. Click to select the IIS Metabase and IIS 6 configuration compatibility check box, and then click OK.

I do not wish to use the IIS Express included with VS but the real local IIS I have installed.

This did not solve the issue. I have yet to find a solution that will allow me (us) to run Visual Studio 2017 and use local IIS without running it as administrator. Can anyone provide a solution?

I'll reference this article as similar but it doesn't resolve the base issue: Debugging website on local IIS without administrative privileges

Jon Glazer
  • 783
  • 1
  • 10
  • 25
  • Do you explicitly want to debug your program with IIS and not IIS Express that comes with Visual Studio? – Esko Dec 28 '17 at 13:42
  • Yes. There are a few reasons for this too but not really applicable to the problem at hand. So yes, I want to use the local IIS. I should have included that in the question (and will edit/add it now). – Jon Glazer Dec 28 '17 at 13:43
  • 1
    The main problem seems to be that the IIS worker thread runs in a different user context than your VS session, and a non-admin-user does not have the permissions to debug a thread running as another user. Thus, you need some kind of admin-level agent which allows you to tap into the worker process. Such an agent exists for remote debugging (https://learn.microsoft.com/en-us/visualstudio/debugger/remote-debugging-aspnet-on-a-remote-iis-7-5-computer), maybe it works locally as well? – Heinzi Dec 28 '17 at 13:43
  • That's a thought @Heinzi and I will give that a try but I think that remote debugger will clash with the one already on the system. This all used to work fine prior to 2017 version. – Jon Glazer Dec 28 '17 at 13:45
  • 1
    @JonGlazer: This seems like a duplicate of https://stackoverflow.com/questions/34656509/debugging-website-on-local-iis-without-administrative-privileges. Does the solution there help? If not, you might want to add that to your question to prevent it from being closed as a dupe. – Heinzi Dec 28 '17 at 13:47
  • @Heinzi it is, indeed, similar but it is not resolved. – Jon Glazer Dec 28 '17 at 13:55
  • 1
    @JonGlazer: Why does it not solve your issue? Can't you set the application pool's thread identity to your user and then "attach to process" without the need to elevate to admin permissions? – Heinzi Dec 28 '17 at 14:01
  • Possible duplicate of [Why run Visual Studio as "Run as Administrator"?](https://stackoverflow.com/questions/20261724/why-run-visual-studio-as-run-as-administrator) – hardkoded Dec 28 '17 at 14:04
  • @JonGlazer - I have a similar need and am curious as to how you resolved this issue? Can you plz share? – aazeem Aug 28 '18 at 21:20

1 Answers1

3

Refer: Why run Visual Studio as "Run as Administrator"?

Its mentioned with MSDN reference that Administrator permissions are required If we need for

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

SSD
  • 1,373
  • 2
  • 13
  • 20
  • I am hoping someone has a solution or work-around. You lose too much functionality being forced to run it that way. I'll accept this otherwise. – Jon Glazer Dec 28 '17 at 13:49
  • We cannot do much, if MSDN says its not possible. :) – SSD Dec 28 '17 at 13:52
  • Well there are some pretty smart people here. Perhaps someone has finally found a workable solution. – Jon Glazer Dec 28 '17 at 13:56