Search code examples
visual-studiodebuggingvisual-studio-2022visual-studio-debuggingtracepoint

Visual Studio Debugger: Is it possible to add Tracepoints with a common action?


I am adding tracepoints for debugging in Visual Studio 2022 with a common action.

(In my case: "{TimeSpan.FromTicks(DateTime.Now.Ticks).TotalSeconds}")

Instead of copy-pasting in the same action for every tracepoint, is there a way I can define the action in one place so adding and modifying each tracepoint is easier?


Solution

  • Instead of copy-pasting in the same action for every tracepoint, is there a way I can define the action in one place so adding and modifying each tracepoint is easier?

    The answer is NO.

    Currently in Visual Studio 2022, there isn't a built-in feature that allows you to define a common action for tracepoints globally or to create a template for tracepoints directly through the user interface. Tracepoints in Visual Studio are set up individually, where each tracepoint must be defined and configured separately.

    And, for the details of the tracepoints, Visual Studio stored it in the .suo file.

    You can take a look of these links:

    Solution User Options (.suo) File

    What is actually contained in a *.suo file?

    The .suo file in Visual Studio is a binary file that contains user-specific settings such as breakpoints, tool window positions, and other IDE states. Because of its binary format, the .suo file is not straightforward to read or write directly in a human-readable form. It is designed to be managed by Visual Studio itself, and its structure is not officially documented for direct manipulation by users or developers.

    The reverse engineering method is not stable, I don't recommend you do that。

    Therefore, for your needs, simply put, it can't be done now, but you can share your ideas with the Visual Studio development team through the following link:

    Suggest to Visual Studio Product Team