Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
178 views

I'm writing a Roslyn analyzer that renames classes matching a certain pattern. The rename "fix" successfully renames the class, but in my unit test (which uses in-memory source which oddly ...
Joel R. Hall's user avatar
1 vote
1 answer
282 views

I'm trying to pretty print the method calls until a specific method for example let's take "DisplayHelp" from this simple random repository I expect for something like Shell.ctor -> ...
ravid's user avatar
  • 39
0 votes
1 answer
146 views

I'm trying to compile this C# code: using System; namespace test { internal static class Program { static void Main() { Console....
acvq136's user avatar
  • 59
0 votes
0 answers
66 views

I'm compiling this code with Visual Studio and with Roslyn (programically). This is .NET 6.0 code. using System; namespace test { internal static class Program { ...
acvq136's user avatar
  • 59
1 vote
1 answer
490 views

I'm trying to create a .NET 6.0 app that will be able to compile another .NET 6.0 app. The problem is Roslyn does not seem to see references. These are some of the errors I received from Roslyn: ...
acvq136's user avatar
  • 59
0 votes
1 answer
755 views

When I load certain old project into MSBuildWorkspace I get the Diagnostic error: Msbuild failed when processing the file "...SomeProj.csproj" with message: The tools version "Current&...
Eugene Shelukhin's user avatar
2 votes
1 answer
166 views

When you put a simple class. public sealed class C { public static void M() { } } into https://sharplab.io/ it translates to (with annotations from me): (source) C.M() L0000: push ebp ...
juwens's user avatar
  • 3,935
1 vote
0 answers
97 views

.NET Framework 4.6.1 (and I should not change version) I'm fixing a code that translates one language from one version into a newer one. For this a property named like "LastBarIndexPainted" ...
marcelloptr's user avatar
0 votes
1 answer
238 views

I'm writing a Roslyn source generator, where I need to grab the initializer from the VariableDeclaratorSyntax.Initializer of a field, and echo it back into a generated file. For example, if I wrote ...
Aaa's user avatar
  • 912
-1 votes
2 answers
221 views

I want get MetadataReference from nupkg package in dotnet //https://learn.microsoft.com/zh-cn/nuget/reference/nuget-client-sdk using FileStream inputStream = new FileStream("C:\\...
lulianqi's user avatar
0 votes
1 answer
96 views

I'm trying to build NLog in Visual Studio 2019 (Community edition, if that's relevant). NLog is not building due to the casting error below. I've searched the code for the "TypeParameterSymbol&...
Henry's user avatar
  • 3
2 votes
1 answer
239 views

I can't generate a readonly record struct using Roslyn. My code: using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; var tree = SyntaxFactory.CompilationUnit() .AddMembers( ...
ASi's user avatar
  • 23
1 vote
1 answer
63 views

I have the following method: public static bool EquivalentTo<T>(this T? current, T? compare) where T : class { if (current is null && compare is null) // both are null ...
IamIC's user avatar
  • 18.4k
0 votes
0 answers
201 views

Is there a csproj target or property that I can use to differentiate the automatic compilation that Roslyn LSP runs to give me diagnostics on VSCode from actual explicit build compilation? I need to ...
geekley's user avatar
  • 1,837
4 votes
1 answer
521 views

How can I compile a single code, as a string, into a working and standalone .exe file? I tried three different things: CSharpCodeProvider: This works fine, but I need it for newer .NET 7 and this ...
Bird2's user avatar
  • 143
2 votes
2 answers
276 views

I'm writing a Roslyn analyzer which detects certain patterns in the code that we don't like, and raising a Diagnostic (the specifics are irrelevant here). However, detecting said patterns is ...
Orion Edwards's user avatar
0 votes
0 answers
113 views

Im trying to write a Roslyn Analyzer which searches in code comments for some kind of hashtags and generates a Gpt prompt from it using the codefix lightbulb. However when sending the gpt request I ...
ChopSeo's user avatar
  • 31
1 vote
2 answers
941 views

I have some C# projects that should have some configurations in the project that references them. I'd like to write a Roslyn analyzer(DiagnosticAnalyzer) to check if those directly referenced projects ...
WAKU's user avatar
  • 349
0 votes
1 answer
124 views

I have a solution where I have a Shared Project of extension ".shproj" I need to add a class to the project with Roslyn, but when I look in the list of projects, It does not contain the ...
ndrespulido's user avatar
1 vote
3 answers
4k views

Maybe it's from the recent VS Code update, It suddenly pops up.. it's highlighting some of my non-error codes in a blue line and sometimes it translucent some of my variables that doesn't have an ...
AgentBurger's user avatar
2 votes
2 answers
498 views

I have built an incremental source generator and packaged it into a nuget package to be consumed by a different solution. I have referenced it in my 'Models' project. The issue is that the Models ...
George Fabish's user avatar
0 votes
1 answer
121 views

I'm looking at this method in ISymbol: string ToMinimalDisplayString(SemanticModel semanticModel, int position, SymbolDisplayFormat format = null); The documentation says that position is "A ...
CarlJ's user avatar
  • 153
0 votes
1 answer
60 views

How can I remove certain fields from the "Configure your new project" when creating a new project template in visual studio? For an example, there is a Framework section where you can choose ...
B. Nir's user avatar
  • 119
0 votes
1 answer
576 views

According to the Incremental Generators documentation, an incremental generator will be called exactly once by the host regardless of how many projects are involved in the compilation: ...
brads3290's user avatar
  • 2,167
0 votes
0 answers
114 views

Unfortunately, I have no minimal sample of the issue, but I've pushed the repo publicly, where it should be reproducable: https://github.com/Yeah69/ContainerFeatureSampleComparison I've implemented a ...
Dima's user avatar
  • 360

1 2
3
4 5
59