Search code examples
c#visual-studiovisual-studio-2017

Visual studio copy type name to clipboard


When you hover on a variable in Visual Studio 2017, the type name is displayed.

Hovering over variable in Visual Studio 2017, displaying type name

How can one copy the string System.Collections.Generic.IEnumerable<IGrouping<FileType, IFileInfo>> into the clipboard?

ReSharper's Copy FQN to Clipboard function copies System.Collections.Generic.IEnumerable to the clipboard, which is certainly in the right direction but not what I'm looking for.


Solution

  • In debugging you could type files.GetType().Name (or .FullName) in the VS Immediate window or elsewhere (quick watch, etc).

    While coding, some VS extensions like resharper allow you to replace the "var" keyword by actual type name in a single click but this is maybe not what you want.