I have the following piece of code: I want to achieve the same thing, but instead of having to specify the type of the expected delegate I want som ...
I have the following piece of code: I want to achieve the same thing, but instead of having to specify the type of the expected delegate I want som ...
I'm using Visual Studio 2022 (17.4.4), and when I create a new empty .NET 6 project, Code Analysis doesn't work. According to MSDN, Roslyn Code Analy ...
I'm using the Visual Studio 2022 (17.4.4). This is a .NET 6 C# project. When running code analysis on my project, I immediately get the message "Code ...
If I understand correctly, there are two kinds of code analysis available for C# Visual Studio projects: The old legacy analyzers (not available f ...
Typically when I implement an interface or write code for which usings are missing it is possible to press Ctrl+. (or right click and press 'Quick Act ...
One of the stated benefits benefits of using the IIncrementalGenerator over ISourceGenerator is that different stages of the pipeline can recognize th ...
I'm writing a Roslyn Source Generator which generates code based on the members of a specified interface. For example, given the following interface: ...
The following source generator creates a new record type on initialization. It then selects the symbol for this type in another step, and generates a ...
I am trying to refactor some code to use dependency injection. I would ike to change this:- to this:- My attempt looks like this:- Stepping t ...
I'm trying to use Roslyn for modifying serializers code generated by svcutil.exe. basically, it contains several dozens medium classes, and two huge c ...
I want to rename a class, its base class and the interface that it supports. For example I want to rewrite this:- to this:- So I wrote this CSha ...
I have a CSharpSyntaxRewriter that adds a new using directive to my file:- The problem is that is adds the new using directive inside the namespace ...
I'm creating a simple Roslyn Source Generator. The generator seems to work well in debug, correctly generating the desired class. However, when refere ...
I have a large number of .Net6 console apps in a solution which all have mostly the same csproj content and contain a single .cs file which differs fr ...
I have the following source code generator Then in the project where I use the source generator I have the following But if I break on Console.W ...
All examples I was able to find testing analyzers and source generators separately. But my analyzer sick to attributes, generated by source generator. ...
I have implemented a custom diagnostic rule in C# using the Roslyn API, but it is not being applied to my code. I have verified that the rule is inclu ...
My source generator depends on a ProjectReference and Basic.Reference.Assemblies. The generator works when I debug it but when I compile a project con ...
tl/dr; My project-referenced Roslyn analyzer works fine in Visual Studio 2019 but fails to load in dotnet build with the following build warning: ...
I've written a CodeAnalyzer/CodeFix using VS Community 17.4.3, and I'm trying to test them with the Visual Studio generated unit test code. The analyz ...