imukai
imukai

Reputation: 688

Visual Studio 2013 Ultimate - CodeLens References and Run As Administrator

This might be obscure. Running VS 2013 Ultimate (Update 5).

When VS is run as Administrator, CodeLens is not showing References, or Unit Test information. If I run as a normal non-elevated state, both show.

Without Administrator - Both References and tests show:

VS Without Administrator

With Administrator - References never update, Tests do not show:

enter image description here

In reading through other SO questions relating to the References not updating, I've tried:

The latter is how I noticed this behavior. I installed the MS Feedback Extension which required VS to restart. Upon using the provided Restart button, I saw the references, so I thought that solution worked. Then I realized VS had restarted without elevated privs. I've since reloaded VS in both conditions and confirmed as Administrator, this happens.

So the question - what exactly is different when VS runs as Administrator that might cause this behavior?

The only thing I can think of is there is a secondary process that is not running with the elevated permissions and thus cannot interact fully with the elevated VS. If that's the case, does anyone have information on what CodeLens runs under?

UPDATE: See my answer below. It seems the culprit is how I was running VS under elevated privs. Short answer: elevate at the .exe level, not from a shortcut.

Upvotes: 0

Views: 137

Answers (1)

imukai
imukai

Reputation: 688

Okay here's how I resolved this. I originally had "Run as Administrator" marked on the Shortcut that is used when VS is pinned to the task bar or through the Start Menu (Windows 7).

Instead I went directly to the devenv.exe itself and marked its Compatibility to "Run this program as Administrator".

Apparently elevating at the shortcut level or right-clicking Run As Administrator on the shortcut does not fully propagate through associated programs? But elevating at the executable level does?

Regardless, VS is now running as Admin and I have my CodeLens information.

Upvotes: 1

Related Questions