Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
22 views

I've been trying to setup roslyn.nvim with rzls.nvim on my neovim for a while to work with .NET, C# and Blazor. But I've been facing some frustrating problems, I'm using WSL Ubuntu 24.04, a neovim ...
Carlos Saraiva's user avatar
0 votes
0 answers
228 views

I am on an air gapped network trying to run a C++ project that uses solution files from Visual Studio, because that is what the rest of my team uses. I have: C# Dev Kit 1.61.22 C# 2.93.21 .NET ...
Alexander Berryhill's user avatar
2 votes
0 answers
50 views

Here is my code: var compilation = CSharpCompilation.Create(asmProps.AssemblyName, syntaxTrees, references, new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, ...
mark's user avatar
  • 63.6k
3 votes
1 answer
154 views

Let's say I want to wrap the classical LogInformation() method with a custom one: public static void Info(this ILogger log, string message, params object[] objects) { // ... some custom logic ...
Massimiliano Kraus's user avatar
2 votes
1 answer
98 views

Using the Roslyn SDK, which SyntaxNode (derived) types can be bound to Symbols, and which methods are used to bind them? So far, I am aware of SemanticModel.GetSymbolInfo(), SemanticModel....
Doodelusion's user avatar
3 votes
2 answers
2k views

Beginner to Roslyn Source Generators here. I'm following the documentation on Source Generators by Microsoft. I have created a .NET Standard 2.0 Class Library, and set the following as the contents of ...
winscripter's user avatar
2 votes
0 answers
68 views

The problem I am implementing an out-of-process C# REPL for a Unity game. I tried an in-process REPL at first, but couldn't get it to work because of some weird VTable related exceptions when loading ...
Dark Daskin's user avatar
  • 1,564
238 votes
17 answers
263k views

In C#, can I convert a string value to a string literal, the way I would see it in code? I would like to replace tabs, newlines, etc. with their escape sequences. If this code: Console.WriteLine(...
Hallgrim's user avatar
  • 15.6k
0 votes
0 answers
142 views

I am writing a code generator to add functions to existing interfaces and that sort of thing. But I can't even get the project to launch. To be clear, it builds, compiles, goes through all the motions,...
Isaac's user avatar
  • 354
91 votes
9 answers
55k views

In old .NET we used to be able to run the csc compiler to compile a single .cs file or several files. With .NET Core we have dotnet build that insists on having a proper project file. Is there a ...
Andrew Savinykh's user avatar
217 votes
5 answers
85k views

In Visual Studio 2015 or later, I can open the 'C# interactive window', and run code: > 5 + 3 8 That's cute. Now how can I interact my code—my classes? Assume I have a project open. > new Cog()...
Colonel Panic's user avatar
0 votes
0 answers
114 views

I'm writing a source generator which will generate factories to create instances of object(s). Since the source generator generates code that's related to tests, I'm going to install the source ...
Complexity's user avatar
  • 5,842
3 votes
1 answer
331 views

I am trying to ban the usage of Newtonsoft.Json package in my codebase, and I am trying to use the BannedApiAnalyzers Nuget package (latest stable version, 3.3.4). My problem is that while I am able ...
Gil's user avatar
  • 179
1 vote
1 answer
64 views

In a source generator, I'd like to determine if a member is IEnumerable or IDictionary. In the sample below, the array member returns IEnumerable, etc. from AllInterfaces, but I get zero interfaces ...
Jim W's user avatar
  • 483
0 votes
0 answers
194 views

As part of a Roslyn Analyzer (C#), I would like to access the intermediate model of Razor parser to check the content for project specific coding guidelines. // Referenced NuGet: // <...
Robert Aichinger's user avatar
6 votes
1 answer
2k views

Roslyn has banned analyzers feature. I want to use in my own code that compiles code dynamically (own scripting engine based on C# lang) via CSharpCompilation class with WithAnalyzers extension method....
Jun's user avatar
  • 71
166 votes
4 answers
28k views

I looked at the source code at http://referencesource.microsoft.com/, and it appears all the source code is in C#. I also looked at the source code for the new C# compiler platform (Roslyn), and it ...
CriketerOnSO's user avatar
  • 2,620
1 vote
0 answers
93 views

I notice that there are mismatches happening in errors and warnings detected by Visual Studio, a locally executed dotnet build <Solution> and the dotnet build <Solution> executed by the CI/...
yulivee's user avatar
  • 347
0 votes
1 answer
120 views

I'm working on a C# application where I need to execute C# code provided as a string input using Roslyn. The challenge is to execute this code and access global variables stored in a Dictionary<...
Youchenn's user avatar
0 votes
1 answer
66 views

I have developed my first diagnostic analyzer and installed it into a test project via NuGet. Everything works find, except that no red line is shown under the issue. I am using context.Node....
Dominick's user avatar
  • 496
0 votes
1 answer
28 views

I am in the process of developing a C# roslyn code analyzer and code fix and am struggling with the proper code to perform the code changes. The analyzer and code fix logic itself does (hopefully) not ...
user1211286's user avatar
1 vote
0 answers
265 views

I'd like to create a NuGet package for a WPF library component that I'm writing. As I'm using WPF classes, I cannot use .NET Standard. So, I need to target .NET 9 and .NET Framework 4.8.1 at the same ...
AxD's user avatar
  • 3,262
122 votes
5 answers
38k views

From a press release yesterday on InfoWorld regarding the new Microsoft Roslyn: The most obvious advantage of this kind of "deconstructed" compiler is that it allows the entire compile-execute ...
mellamokb's user avatar
  • 56.8k
1 vote
1 answer
282 views

I'm creating custom roslyn analyzers in order to enforce custom code style rules in my project. So far it's been going well with the help of AI generators for .cs files. However I cannot get an ...
Alex's user avatar
  • 913
0 votes
0 answers
137 views

I use Roslyn to analyze field initializations. One of the analysis target is the following field. private static readonly ImmutableDictionary<int, int> _Map = new Dictionary<int, int> { ...
user4134476's user avatar

1
2 3 4 5
59