Skip to main content
-2 votes
4 answers
143 views

I'm working on a .NET application where every command/query handler needs access to three shared services: IValidator, ISecurity and ILogger. Rather than manually injecting these into each handler ...
Mahmudul Hasan's user avatar
2 votes
0 answers
75 views

I have a .NET analyzer (source generator) project referencing a NuGet package. I am trying to create an integration test project to test the source generator under real conditions. To accomplish this, ...
Paul Dubsky's user avatar
1 vote
1 answer
1k views

I have following Execute method in my source generator. I can get all the properties (x.Item1.Members.AsEnumerable()...) of my class. But I can't manage to get the properties of the base class too. ...
Dani's user avatar
  • 1,097
3 votes
2 answers
2k views

I have following Attribute: [AttributeUsage(AttributeTargets.Class)] public class EventApplyAttribute : Attribute { public string Aggregate { get; } public EventApplyAttribute(string ...
Dani's user avatar
  • 1,097
3 votes
0 answers
168 views

I would like to use a C# code generator for a polyglot notebook. (My eventual goal is to generate a strongly typed object model from a CSV or excel file I wish to analyze.) In an initial test I ...
John Melville's user avatar
4 votes
0 answers
1k views

I spent all day trying to run a Source Generator in Visual Studio 2022. I downloaded a few source code and none of them is working. Neither the Microsoft examples. I was trying to use a code to create ...
Enrico's user avatar
  • 6,872
1 vote
1 answer
197 views

I create my first Nuget Package of my incremental source generator. All was OK, targeting it as an analyzer in .csproj, embedded under analyzer/cs Nuget subfolders. But now I want to improve my ...
TRex's user avatar
  • 350
0 votes
0 answers
264 views

I have a generic class and i need to access all generic usages of that class using incremental source generators. My class is like: public class User<T> { public int Id { get; set; } ...
İsmail Furkan GÖKHASAN's user avatar
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
0 votes
0 answers
225 views

I am stuck at this issue for sometime and looking for implementation ideas and/or code snippets. So I have 2 projects: A dotnet maui project which has a xml file. A class library which does something. ...
Prabhav Mehra's user avatar
2 votes
1 answer
2k views

C# Source generated files are ignored or show errors but when I copy the file out everything works. state.Text.g.cs using System.Collections.Generic; using System.Linq; #nullable enable namespace ...
Drachencheat's user avatar
2 votes
1 answer
693 views

I'm working on a project in which the majority of the code is generated. I'm fully aware of what a useless metric SLOC is, but I'd like to brag about how much work and potential human error the code ...
Kevin Krumwiede's user avatar
0 votes
1 answer
140 views

I wrote a Roslyn source generator that visits all of my controllers' methods that have an HttpGet, HttpPut, HttpDelete or HttpPost attribute on them, and then makes classes like this, that I was ...
Taylor C. White's user avatar
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
3 votes
2 answers
7k views

I want to create an incremental source generator that reads a json file and creates some classes out of it. Unfortunately, when I build my solution, no files are generated. Even the debugger statement ...
Michael Tontchev's user avatar

15 30 50 per page
1
2 3 4 5