'How to open a C# call stack (string) in Visual Studio 2019 Professional?

OK, suppose I have a C# string for a callstack for a runtime Exception (copied to the clipboard from Azure Application Insights - but it could be from everywhere). Note that this is not from an active debug session in Visual Studio.

Now I want to open this callstack in Visual Studio. How can I do this, without having to manually read the string, find the top of the stack, and then try to open it?

Surely there should be a built-in feature, or an extension, that can "open callstack"?



Solution 1:[1]

In Visual studio 2022 this feature has been added.

Hit Ctrl + E, S (keep Ctrl down while pressing E and then S).

Via the menu you can reach it via View -> Other Windows -> Stack Trace Explorer.

Once the window is open, you can click on any of the lines and you will navigate to the spot instantly. Saves a ton of navigation time!

If you have an older version of Visual studio with JetBrains Resharper the keystroke is Extra-Terrestrial (that's how I remembered it) Ctrl + E, T.

Solution 2:[2]

I think you should get the dump file of it. You can check this link.

Then, use VS debugger to debug the dump file. Otherwise, you have to manually navigate to the string line.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Mr Qian