On my work machine, I have IIS installed to test and debug .NET applications using Visual Studio. For the most part I run Visual Studio using Run As Administrator
with my primary network account because my development requires my local IIS environment. However there are times where a project or entire solution needs to be run under another network account to test features that my normal network account cannot access but all the while still using my local IIS environment.
Just for noting, IIS Express is not a viable option because testing and debugging is preferred to be done in an environment that closely resembles a production server environment. Additionally I have application pools that are bound to different service accounts (even including my secondary account) so I can test apps against different database dev systems.
The issue I am running into is that when I go to debug an application with my secondary account, Visual Studio warns that it needs to restart because the application requires elevated permissions to access my local IIS environment. Both of the accounts have been assigned to power users and administrators security groups on my machine via the "Local Users and Groups", but that has had no effect. If I run Visual Studio using the secondary account using the RUNAS
command, there does not appear to be a way to also use Run As Administrator
option at the same time.
I have tried various tricks such as creating a shortcut using the follow code:
C:\Windows\System32\runas.exe /user:elevatedUser@domain.network "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.exe"
and then going to the properties for the newly created shortcut and checking the checkbox to
Run As Administrator
to see if that works but to know avail.
Is there a way to actually do this, or better yet, is there way to tell my local IIS environment which users from Visual Studio are granted full rights by default without having to use elevation?
Thanks.