Creating a Roslyn Analyzer that wraps code in a try/catch statement

from blog Blog posts on .NET Software Development, C#, and Debugging on Michael's Coding Spot, | ↗ original
I recently had to create a Roslyn Analyzer that envelopes code in a try/catch statement. This reasoning was to prevent loading errors in any exported MEF component . Here’s the analyzer in action: The analyzer does the following: Adds a Diagnostic that finds a MEF ImportingConstructor with content that’s not entirely wrapped in a try/catch...