Open a file in the current instance of Visual Studio when working under different credentials

I am working on a project that is hosted in IIS, and therefore, to debug this site, I have to start Visual Studio as an administrator.

The problem is that when I open the file in Windows Explorer, I would like to open it in the current instance of Visual Studio (or in a new instance if it is not).

I had partial success using a batch file with the following contents:

cd "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE" devenv /Edit %1

However, this opens Visual Studio as the current user, NOT as an administrator (therefore, when I have an instance already open as an administrator, it still opens a new instance).

So the question is: how can I open the file in the current instance as an administrator?

+4
source share
1 answer
  • Shift + right-click the file in Explorer
  • Press "a" in the pop-up menu (select "Copy as path")
  • Switch to Visual Studio
  • Press Ctrl + O, then Ctrl + V, then Enter

Perhaps you can make some sort of AutoHotkey script to automate it, depending on how often you need to do this.

+2
source

Source: https://habr.com/ru/post/1532125/


All Articles