question

Cairn-3868 avatar image
1 Vote"
Cairn-3868 asked TianyuSun-MSFT edited

Debuging a Roslyn Analyser

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.

vs-extensions
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

TianyuSun-MSFT avatar image
0 Votes"
TianyuSun-MSFT answered TianyuSun-MSFT edited

Hello @Cairn-3868 ,

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.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

All the documentation and books I have read on this say the way to do this is to run the Vsix which creates a development instance of Visual studio. I can see the plugin is present, but it does not trigger any breakpoints set in the code.

1 Vote 1 ·

Hi @Cairn-3868 , thank you for the feedback. I checked again and I can reproduce this issue. I noticed that this issue has been reported in our Developer Community, please kindly follow, vote for this thread: Debugging Roslyn analyzer as VSIX extension no longer works in VS 2019, symbols are loaded but no breakpoint is ever hit and wait to see the updates(cause/suggestions/solutions/workarounds/Fixed Release…). Thanks for helping us make Visual Studio better.

0 Votes 0 ·