Does anyone know how to get the name of the user who's currently signed into Visual Studio from C#?
Basically I want my VS extension to be able to greet the user by name (ie whoever's signed in to the current VS session).
Does anyone know how to get the name of the user who's currently signed into Visual Studio from C#?
Basically I want my VS extension to be able to greet the user by name (ie whoever's signed in to the current VS session).
AFAIK, there's no API in VS SDK can support this behavior. So you may have to code to read the related value about current account from Registry using Register.CurrentUser.
Check the answer from Hadi and thanks to him, I think it's what you're after. And it works well for VS2015 and VS2017 after my test.