Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
214 views

I'm using Roslyn to compile strings of C# code. I'd like to use the output of one of the compilations as metadata reference for another, but when I try to invoke a method that forces the loading of ...
Peter Lenkefi's user avatar
1 vote
1 answer
641 views

I want to write a new project with Roslyn Analyzer in .NET 7 My purpose is that to find all references for a method in a project as programmatically. I loaded the solution like the below code. ...
hakanaltindis's user avatar
0 votes
2 answers
1k views

I'm implementing a feature where a user can write an arbitrary expression that needs to be evaluated against some context. Users should be able to write expressions referring to a dynamic JSON payload....
Jorgoth's user avatar
  • 35
1 vote
1 answer
314 views

After updating packages to .net7 in roslyn code generation project, has error RS1024 Use 'SymbolEqualityComparer' when comparing symbols for IEqualityComparer implementation of GetHashCode() public ...
userahd's user avatar
  • 67
0 votes
0 answers
233 views

Can you import a Roslyn Analyzer from a NuGet package and manually call/ use them in your own code for analysing an external solution (for example letting it analyze a public git repo that you ...
Michel Matthe's user avatar
0 votes
0 answers
572 views

why it throw the error "Could not find a part of the path ... bin\roslyn\csc.exe" ? One working project failed to compile after I made a fresh checkout. The same commit that before worked ...
Darshil Sakdecha's user avatar
0 votes
0 answers
164 views

I have made a Visual Studio extension that can be used within Visual Studio 2022 to upload certain types of files (.cs and .vb) to a code security scanning engine. To do this, I’m using a tool called ...
Lalindu's user avatar
  • 341
0 votes
2 answers
128 views

When I extract method from this code, final result have global::System.Int32[] list as parameter in NewMethod: using System; public class Program { public static void Main(string[] args) { ...
Darko's user avatar
  • 1
1 vote
1 answer
202 views

In a C# incremental generator I am authoring, beginning from an ArgumentSyntax, I am trying to inspect the inline initializer for a readonly field referenced as a method argument. Understanding that ...
monkey0506's user avatar
  • 2,627
1 vote
1 answer
136 views

Given SomeInterfaceType that has a method with optional parameters: interface SomeInterface { void SomeMethod(int a = 1, string c = "foo", SomeType e = default, ...
xvan's user avatar
  • 4,849
0 votes
1 answer
684 views

I am a beginner level programmer, trying to create a code editor for C# with RoslynPad. I've added the editor control to my WPF window, and highlighting also works. I would also like to enable code ...
bBen1997's user avatar
0 votes
1 answer
408 views

I got a class that currently needs to be registered like this (to work reflection-free) ViewLocator = new StrongViewLocator() .Register<MainWindowViewModel>(new ViewDefinition(typeof(...
Etienne Charland's user avatar
0 votes
1 answer
406 views

I'm currently trying to compile a solution during runtime execution of my own program. This solution is user defined and must have support for any number of projects and in these any nuget dependency ...
MansenC's user avatar
  • 111
1 vote
0 answers
120 views

I am trying to explore Roslyn's code completion service. I am able to get the completion list, but when I try to get the description it only returns the type and access modifiers, but not the actual ...
iamveryconfused's user avatar
0 votes
0 answers
368 views

Is it possible to get the property that an attribute refers to using Roslyn syntax analysis? I was able to get the attribute name as follows: using System; using System.Collections.Generic; using ...
user32882's user avatar
  • 6,107
1 vote
1 answer
432 views

I'm trying to make Roslyn/MSBuildWorkspace work on some older .NET Framework projects. Those occasionally have COM references, some of them incorrect. Compiling in Visual Studio works with warnings: 2&...
Timur Kelman's user avatar
2 votes
0 answers
571 views

I am using Roslyn to compile and run C# scripts entered by the user. I would like to dynamically react to the script choosing different assemblies to load (for example, adding 'using System.Net.Http' ...
Jalconvolvon2's user avatar
1 vote
1 answer
175 views

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 Analyzers are automatically enabled for every new .NET 6 ...
LTR's user avatar
  • 1,402
0 votes
1 answer
120 views

If I understand correctly, there are two kinds of code analysis available for C# Visual Studio projects: The old legacy analyzers (not available for .NET Core and .NET Standard) Roslyn Code Analyzers ...
LTR's user avatar
  • 1,402
1 vote
1 answer
196 views

I am trying to find a good solution to finding out whether a dependency on another class in C# is in composition or agreggation. Is there a better way to do it than like this? private static ...
Dan Vyhlidal's user avatar
1 vote
1 answer
176 views

One of the stated benefits benefits of using the IIncrementalGenerator over ISourceGenerator is that different stages of the pipeline can recognize that the results of the current iteration is the ...
Andrew Moskevitz's user avatar
0 votes
2 answers
635 views

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 dummy file with a timestamp. Since the underlying ...
Bogey's user avatar
  • 5,916
0 votes
1 answer
86 views

I'm trying to use Roslyn for modifying serializers code generated by svcutil.exe. basically, it contains several dozens medium classes, and two huge classes (reader and writer) that contains a ...
Omer Ran's user avatar
2 votes
1 answer
143 views

I have a CSharpSyntaxRewriter that adds a new using directive to my file:- public class AddUsingDirective : CSharpSyntaxRewriter { public override SyntaxNode VisitNamespaceDeclaration(...
James Moot's user avatar
0 votes
0 answers
51 views

I am trying to add a constructor to a class using Roslyn. My skeleton code looks like this: public class AddConstructor : CSharpSyntaxRewriter { public override SyntaxNode VisitClassDeclaration(...
James Moot's user avatar

1 2 3
4
5
59