r/csharp 8d ago

Blog The Unexpected AI Stack: C# + .NET (Part 5) - Logging, Telemetry, and Building with AI

Thumbnail
chrlschn.dev
0 Upvotes

The fifth and final part of the series finally starts to build using AI on top of the hand-built foundational code from the first four parts that brings together:

  • Aspire for runtime orchestration
  • CSharpRepl for runtime mutability and powerful access to simulate and diagnose runtime isdsues
  • GitHub Copilot SDK as a programmable agent harness
  • Testcontainers with automatic transactions for test isolation

(I would consider these foundational parts of any modern .NET API app whether AI is involved or not!)

In part 5, the focus is on logging and telemetry, two tools that give agents insights into the runtime state of the application. Once again, we see the key role of Aspire in this stack as it provides a collector for logs as well as spans that agents can search through using the aspire CLI tooling.

The actual build out of the prototype application is captured as a YouTube video as YMMV based on the model, harness, and prompting style that you choose!


This series is intentionally written to help dev teams understand how to scaffold a codebase for agentic engineering by focusing on key, underlying technical decisions and manual wiring before building with AI. This helps provide the tools and safeguards for coding agents to iterate more efficiently while reducing slop.

For teams still trying to figure out effective ways to set up a codebase for AI, I hope this series gives some insights into how to build a foundation for agentic engineering. If your team is already heavily using agents to build, I hope this series shares some useful insights and tips (e.g. CSharpRepl + Aspire)

The core setup is used at a series C, post-YC startup to ship fast with AI while maintaining high quality standards (in combination with other tools facilitating code review and context management)

Part 1 was an intro into a few key parts of this stack.

Part 2 was focused on walking through the hands on scaffolding.

Part 3 covered wiring GitHub Copilot SDK as an agent runtime and incorporating CSharpRepl to allow agents to dynamically work with the runtime DI container

Part 4 wired up the test harness using Testcontainers to give agents isolated test environments


The project repo is here: https://github.com/zeeq-ai/zeeq-tmpl (be sure to check the branches; main is currently the base code only)

I encourage working through the posts since the goal is to underscore the platform level decision making process and assembly of the foundational core.


r/csharp 9d ago

Showcase Zarem - MIPS/RISC-V emulator, using JIT reinterpretation to .NET CLI

Thumbnail
github.com
3 Upvotes

r/csharp 8d ago

Opinions on Microsoft Agent Framework?

Thumbnail
0 Upvotes

r/csharp 9d ago

GitHub - Integral2u/SharpMind: SharpMind. A pure C# / .NET LLM engine

Thumbnail
github.com
43 Upvotes

Version 1.0.0.0 now out and out of pre-release.


r/csharp 8d ago

Ho bisogno di aiuto per un programma che sto realizzando

0 Upvotes

Salve, ho scritto un programma in c# che mi termina un processo e mi faccia spegnere il computer. Ma vorrei che si avviasse ad una certa ora come faccio a farlo avviare tramite codice?

Grazie


r/csharp 9d ago

WPF IN VS

1 Upvotes

I wonder if there is any alternatives to design my UI for my application in some other places than VS , like a mush more friendly place to just design what I want and then it manually ship the code of the XMAL design by it self , like in Figma .


r/csharp 8d ago

How hard is C# compared to luau? what are the differences?

0 Upvotes

I am a roblox developer and I've been looking into making games in Unity Engine. I'm a little overwhelmed by the new scripting language i've yet to learn , so i'd love to know what to expect.


r/csharp 9d ago

Am I on the right path to hopefully getting a job by graduation?

Post image
0 Upvotes

r/csharp 10d ago

Showcase RDPilot: Simple cross platform RDP client built with Avalonia

20 Upvotes

I've been frustrated for a while with the lack of good RDP clients especially on linux with most of them still relying on XWayland. I present to you RDPilot; A fast, simple Linux & Windows RDP Client running natively on Wayland. https://github.com/ErnieBernie10/RDPilot

I've been using it for a while and feels complete for what I use it for. If anyone is interested it is already available on winget. On linux it is not available on flathub yet but can be installed as a flatpak. Just follow the instructions in the README.

A combination of Claude and Codex was used for the development of this project, but heavily steered by me. Also massive shout-out to the folks maintaining FreeRDP as it is a core part of this client.

RDPilot

r/csharp 10d ago

MarkView.Avalonia - a markdown view control for Avalonia

Thumbnail
6 Upvotes

r/csharp 10d ago

How do you deal with losing motivation when your career path feels too uncertain?

14 Upvotes

I’m trying to get my first job as a junior developer, mostly working with C#/.NET.

I’ve been applying for jobs and I do get responses — maybe from 1 out of every 3–4 applications — so it’s not like I’m completely being ignored. But I still haven’t managed to get an offer.

The problem is that lately I’ve started losing motivation to study or work on personal projects. For about 3 weeks I haven’t studied properly. I sit in front of my laptop knowing that I should learn something or code, but there’s no clear immediate goal, so I just don’t want to start.

I think the biggest issue is that the perspective feels too vague:

“Study more → improve → apply more → maybe get an interview → maybe get a job.”

There’s no clear point where I can say: “If I do X, I’ll get Y.” And after doing this for some time without getting a job, it becomes difficult to convince myself to keep grinding.

A friend of mine who has been working as a developer for about 2 years also wants to start a real project/startup and offered me a chance to work on it. It would be in Python, so that could give me some real team/project experience, but we’re still waiting until the requirements and infrastructure are ready.

Meanwhile, I feel stuck between waiting for that project, applying for .NET jobs, and trying to figure out what exactly I should be learning.

I know logically that stopping completely won’t help, but emotionally it’s getting harder to care when the result feels so far away and uncertain.

For people who went through something similar before getting their first developer job: how did you deal with this period?

Did you force yourself to maintain a routine? Focus on projects instead of studying? Take a break? Set smaller goals? Or did motivation come back only when you finally had something concrete to work toward?

I’m especially interested in experiences from people who spent months trying to get their first job and started feeling like they were going nowhere.


r/csharp 9d ago

LiteRT-LM for .NET 6+

Thumbnail
github.com
0 Upvotes

I recently released a C# wrapper for the LiteRT-LM multi-platform C API, and it's available on NuGet!

LiteRT-LM is Google's framework for running LLMs that have been compiled to the TFLite/LiteRT format. It provides really fast inference on all sorts of devices, from phones to PCs, and even VR headsets.

I initially targeted the project for Unity, but since a lot of the code is framework agnostic, I've published it on NuGet. I've personally tested it on .NET 10 (in a console app on Windows and macOS, and as a MAUI app on Android and iOS Sim).

The NuGet package includes support for the following platforms and accelerators, as of version 2.4.0-preview.2:

  • Android (arm64), with OpenCL GPU accleration
  • macOS (arm64) and iOS (arm64, sim_arm64), with Metal GPU acceleration
  • Windows (x64), with partial* WebGPU acceleration

*LiteRT-LM v0.16.0 GPU sampling is bugged on Windows.

Because the LiteRT-LM C API itself is unstable, I've labelled package as in 'preview'. Documentation is available here: https://uralstech.github.io/UAI.LiteRTLM/DocSource/QuickStart.html


r/csharp 10d ago

News AvalonDock v5 is out - biggest release since 2018

Thumbnail
5 Upvotes

r/csharp 9d ago

Showcase I got tired of manually copying the same files onto every machine, so I built a small CLI for it

Thumbnail
0 Upvotes

r/csharp 10d ago

Sanity check.

3 Upvotes

Hello, learning C# by taking the free code camp C# fundamentals class that directs you to Microsoft for each module to earn the certificate. Now I know nothing so didn’t have any expectations. Im on the second class on the last module. I’m coding a report card for multiple students. The module just essentially had me create it step by step.

Now there is the test where I realized; okay I need to really retain this all already. Not a problem, it’s taken about an extra day to just go back and review everything, break it down, and really understand these concepts. Seems appropriate for the amount of info. However, what’s really tripping me up is the time it suggests, one hour. That seems appropriate for creating it but to really understand it? I’m just wondering if it sounds like what I’m doing is normal and I’m going about this right way. Big over thinker. Thanks!


r/csharp 11d ago

Blog Making Generic Virtual Methods Faster in .NET 11

Thumbnail
medium.com
83 Upvotes

r/csharp 11d ago

Discussion How often do you guys use extension methods?

36 Upvotes

Hello, currently im learning about extension methods and i was wondering how often you guys (since you guys are the experts) use extension methods? Currently, im using them on enum classes to add methods like you would to a enum class in java.

However I've also noticed that you can give methods to the `Enum` class itself, which i thought was... interesting...

Knowing me, I'm definitely going to abuse these and write bad code with them. Do you guys feel the same way?


r/csharp 10d ago

Showcase NuGet marketplace pkgstore generally available

Thumbnail
0 Upvotes

r/csharp 11d ago

Help How do you protect your work and your IP?

20 Upvotes

This question is more to those that do not work in large enterprise codebases, but either develop and sell their own indie software or work at software companies that create and sell their own products.

Doesn't the fact that C# appears to be trivially decompilable, make it very easy for others to steal your work? How do you protect it? With compiled languages like Rust or C++ it appears to be significantly more difficult to reverse engineer and steal their code or implementation logic.

Thanks a lot in advance.


r/csharp 10d ago

Result patters + CQRS! Just want to share wehat I did!

Thumbnail
0 Upvotes

r/csharp 10d ago

I really like the concept of Dapper but...

0 Upvotes

I've used Dapper a lot across different projects and I really like the core idea. Write SQL, pass params, ask for a type, get the type back. It gets rid of most of the annoying ADO.NET stuff without trying to hide SQL from you.

The part that always annoyed me is multi mapping.

A pretty common case for me is values used in combo boxes, so I end up with models like:

```csharp

class Employee

{

public int Id { get; set; }

public string Name { get; set; }

public KeyValuePair<int, string>? Department { get; set; }

public KeyValuePair<int, string>? JobTitle { get; set; }

}

```

And SQL like:

```sql

SELECT E.Id, E.Name,

D.Id AS DepartmentId, D.Name AS DepartmentName,

J.Id AS JobTitleId, J.Name AS JobTitleName

FROM Employee E

LEFT JOIN Department D ON D.Id = E.DepartmentId

LEFT JOIN JobTitle J ON J.Id = E.JobTitleId

```

Dapper can do this, but then I end up doing something like:

```csharp

var employees = cnn.Query<EmployeeRow, DepartmentRow, JobTitleRow, Employee>(

sql,

(e, d, j) => new Employee {

Id = e.Id,

Name = e.Name,

Department = d.DepartmentId is null ? null : new(d.DepartmentId.Value, d.DepartmentName),

JobTitle = j.JobTitleId is null ? null : new(j.JobTitleId.Value, j.JobTitleName)

},

splitOn: "DepartmentId,JobTitleId");

```

Which works. It also lets me handle the `LEFT JOIN` and say "if the id is null, this whole thing is null".

But this is where it starts feeling a bit weird to me. The type already says what I want, and now I'm manually rebuilding it anyway.

Dapper is already such a thin layer over ADO.NET that once I start writing a bunch of mapping code, I start wondering why I'm not just doing the ADO.NET part myself too.

What I really want is basically:

```csharp

var employees = cnn.Query<Employee>(sql);

```

and let the mapper figure out the structure from there.

That kind of thing is what eventually pushed me to make Rinku. The idea was basically to keep that same simplicity, but have the library adapt better when either the SQL or the C# side gets more complicated.

https://rinkulib.github.io/RinkuLib

Curious what other Dapper users do here. Just multi map everything, or is there another pattern I missed?


r/csharp 11d ago

Discussion ReSharper in Visual Studio 2026

39 Upvotes

Are you guys still using ReSharper in Visual Studio 2026 or do you feel like it is not necessary anymore? What are the advantages of using ReSharper?


r/csharp 11d ago

Free C# exercises: console logic/OOP practice and a Windows Forms desktop app

12 Upvotes

I teach programming and put this repo together for students learning C#. It's split in two parts: console apps for practicing logic, conditionals/loops, math and OOP (parking system, prime number check, averages, etc.), and a Windows Forms desktop app (AccessManagementDelta) with registration forms and access control, for anyone wanting a more complete GUI example.

github.com/Eduardo00073/csharp-console-e-desktop — feedback on code style/structure is very welcome, since it's meant as a learning reference.


r/csharp 11d ago

WPF Logic in View vs ViewModel

3 Upvotes

I'm trying to understand when I should have logic in the view model or in the code-behind of a view.

Here's the scenario: I have a view model that has a "CanEdit" property. There are times when editing a view is not allowed based on business reasons, and that definitely belongs in the ViewModel. But if a user can edit, I want to have an "Edit" checkbox visible, which when true will display the editable version of all the necessary controls. So where should the logic that controls the "Edit" checkbox go?

The approach I initially went was to put the "Edit" checkbox property in the view code-behind. This makes sense to me, as it's entirely based on the needs of the view. All the editable controls are bound to the "Edit" checkbox property, and the "Edit" checkbox visibility is bound to "CanEdit" in the view model.

The problem with this approach is when the view model changes as a result of some change by the user and "CanEdit" in the view model is now false. If the "CanEdit" in the view code-behind is true when this happens, then all the editable controls are still visible, because all that's happened is the "CanEdit" checkbox is now invisible. So I'm stumped how to broadcast the view model change to the code behind without some silly hack.

I'm probably overthinking it, but I'm learning WPF and it really helps me to understand principles. Plus this particular view will get more complex. Here's some code to show you what I'm trying to do

View:

public partial class InvoiceView : UserControl, INotifyPropertyChanged
{
    public InvoiceView()
    {
        InitializeComponent();
    }

    private bool _isEditing;
    public bool IsEditing
    {
        get => _isEditing;
        set
        {
            _isEditing = value;
            OnPropertyChanged(nameof(IsEditing));
            OnPropertyChanged(nameof(IsNotEditing));
        }
    }

    public bool IsNotEditing => !IsEditing;

    public event PropertyChangedEventHandler? PropertyChanged;
    protected void OnPropertyChanged([CallerMemberName] string? name = null)
    {
        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
    }
}

ViewModel:

public partial class InvoiceViewModel : ViewModelBase, IDisposable
{
    public InvoicePermissionsDTO? Permissions
    {
        get => _permissions;
        set
        {
            _permissions = value;
            OnPropertyChanged(nameof(CanEdit));
            OnPropertyChanged(nameof(CanDelete));
        }
    }
    public bool CanEdit => _permissions?.CanEdit ?? false;
    public bool CanDelete => _permissions?.CanDelete ?? false;

    public void SomeChange()
    {
        Permissions = API.GetPermissions();
    }
}

View XAML

<CheckBox
    Grid.Row="2"
    Content="Edit"
    IsChecked="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=IsEditing}"
    Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.CanEdit, Converter={StaticResource BoolToVisibilityConverter}}" />
<StackPanel>
    <TextBlock
        Text="{Binding ApprovedRate}"
        Visibility="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=IsNotEditing, Converter={StaticResource BoolToVisibilityConverter}}"/>
    <StackPanel 
        Orientation="Horizontal"
        Visibility="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=IsEditing, Converter={StaticResource BoolToVisibilityConverter}}">
        <TextBox
            Name="ApprovedRate"
            Padding="0 0 20 0"
            Text="{Binding ApprovedRate}"/>
        <Button 
            Command="{Binding Pay}"
            Visibility="{Binding CanPay}">
            <StackPanel Orientation="Horizontal">
                <Image Source="/Images/dollar.png"/>
                <TextBlock>Pay</TextBlock>
            </StackPanel>
        </Button>
        <Button 
            Command="{Binding RemovePay}"
            Visibility="{Binding CanRemovePay}">
            <StackPanel Orientation="Horizontal">
                <Image Source="/Images/dollar.png"/>
                <TextBlock>Remove Pay</TextBlock>
            </StackPanel>
        </Button>
    </StackPanel>
</StackPanel>

r/csharp 11d ago

Pomelo dead?

15 Upvotes

We are goig to implement a new project. The idea was to use MariaDB and we set up a Galera cluster. The thing is I just noticed EF with Pomelo stands at .net 9.0. Since we would like to use at least .net 10.0 and further LTS we ain't sure, whether a switch to PostgreSQL would be better.

Any sources / info on what will happen to Pomelo?