Instead of installing a new extension (as mentioned in the other answers), you can just use a built-in tool in Visual Studio called "C# Interactive".
Here are the steps:
- On VS open the "C# Interactive" window (if not opened) by
pressing Ctrl+Q and typing "C# Interactive"
- Type the following in the window and press enter:
System.Guid.NewGuid().ToString()
And you'll get the result:
Note: In case you need it again, just hit Up Arrow button and the last command will reappear, so you don't need to type again.
P.S. Basically we just execute a C# code in the "C# Interactive" window.
You can modify the code there to whatever you want.
For example, you can go further and generate a list of guids with by typing there a code like this:
> for (int i = 0; i < 100; i++)
{
Console.WriteLine(Guid.NewGuid().ToString());
}