Share via

Debuging a Roslyn Analyser

Cairn 41 Reputation points
2021-05-05T18:11:39.487+00:00

I have created a analyser and set breakpoints in the Initialize and AnalyizeSymbol methods. Built the project and run the Vsix. When set running another instance of Visual Studio is created. I create a new C# class library and attempt to update the class name. None of the breakpoints hit. I am using Visual Studio 2019 16.9.4.
Any ideals on why the breakpoints don't hit. I have looked at running extensions and the created analyser is present and running.

Community Center | Not monitored
0 comments No comments

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 34,836 Reputation points Microsoft External Staff
    2021-05-06T03:36:48.357+00:00

    Hello @Cairn ,

    Welcome to Microsoft Q&A forum.

    I think, VS extension project for Roslyn Analyzer is a little different from other extensions.

    Due to its function, you may need to use .Test project(the default name is [your project/solution name].Test) which is included in your analyzer solution, and write unit tests to validate every case works as expected.

    Best Regards,
    Tianyu

    • If the answer is helpful, please click "Accept Answer" and upvote it.
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.