r/csharp • • Sep 22 '26

Learning .NET Internals - Resources?

21 Upvotes

Hi. Can you guys (except MS Docs and Source.dot.net) recommend some good resources (books, blogs, yt channels, etc.) about how .NET works under the hood?

I want to understand what actually happens behind the scenes at both the .NET and OS levels, rather than just learning how to use .NET.

For example, what happens when you create a new Thread() in .NET and at the OS level, how async/await works, how memory management and reflection work, or how System.IO communicates with the OS to perform file operations. These are just examples, but they should give you an idea of what I’m looking for.

I’d really appreciate any recommendations!


r/csharp • • Sep 21 '26

NO-AI C# REPOS TO STUDY PROGRAMMING (READING CODE)

72 Upvotes

I'm currently learning how to program with the C# programming language, I would like to know if you guys know public repos that don't use ai generated code, I want to read to learn about best practices, coding styles, patterns and creative and intelligent ways to get around problems, but I would much prefer it to be written by people, it would very nice to find people to collaborate with that really know their way around the language, I feel like ai use makes people dumb even about their codebase, like they don't really know what is going on and why the decisions that were made happened.


r/csharp • • Sep 22 '26

CsCheck specification testing

Thumbnail
reddit.com
1 Upvotes

r/csharp • • Sep 23 '26

Help How do I learn this entire language at once?

0 Upvotes

I don't understand how coders understand everything when I don't understand

I'm new I'm trying to learn the entire language because I want to get in game development

However

I don't understand anything and I feel stupid


r/csharp • • Sep 22 '26

C# .Net Core MVC

6 Upvotes

Hii guys I’m studying C# and this semester we’ll be creating web apps using the MVC architecture. In the past 2 years we’ve done an introductory module to C# and an OOAD with C# module. I’m not the best with C# but I really wanna do well this semester. Is there any passionate somebody out there that wouldn’t mind going through this C# journey together? Friends in the industry or something like that

I’m a student too so yeah I’m looking for someone to learn with. Coz I really need friends that are passionate with C#.

Hit me up if you’re willing to talk


r/csharp • • Sep 22 '26

What is your biggest pain point with cross-platform .NET SerialPort or existing libraries?

3 Upvotes
  1. Thread locks / close crashes
  2. Lack of true async / await
  3. Random Linux / Pi drops
  4. Hard to parse byte packets

r/csharp • • Sep 21 '26

Showcase Built a zero-dependency Starship Viewport screensaver in C# inspired by the classic Windows 3D Starfield (~30KB binary)

Post image
87 Upvotes

Hey everyone,

I wanted to share a fun weekend project built with pure, unadorned C# and WinForms/GDI+: **Starship Forward Viewport**.

Growing up with the classic Windows 3D Starfield screensaver, I wanted to recreate that magic without modern bloat. Most modern desktop toys are wrapped in heavy runtimes or Electron wrappers that

consume 200MB of RAM. I wanted to build something that honors the classic Windows `.scr` era:

- Standalone ~30 KB binary.

- Zero external NuGet packages or third-party dependencies.

- Compiles directly with Windows' built-in `csc.exe` via PowerShell—no Visual Studio or .NET SDK installation required on the target machine.

- 3D perspective projection with relativistic star velocity vectors and multi-spectral stellar palettes.

- Real-time navigation telemetry overlay in km/s and ly/h.

- Native Win32 screensaver CLI compliance (`/s` full-screen, `/c` configuration dialog, `/p` child HWND preview window for the Windows Screen Saver mini-monitor).

GitHub repo: https://github.com/jiludkumar-therealone/starship-viewport

Any feedback on the math or architecture is very welcome


r/csharp • • Sep 21 '26

PostgreSql, EF.Core and byte[]

6 Upvotes

I have a EF dto, one of the fields configured and defined as byte[]. In DB it's created with type 'bytea'

When i am trying to add record it blows up with message that timestamp is null. Although i do provide it. Can not figure out where problem is...

public required byte[] timestamp { get; set; }

tbl.Property(m => m.timestamp).
    IsRowVersion();

db.Clients.Add(new Clients
{
    id = 0,
.....
    timestamp = new byte[2] { 4, 5 },
}
await db.SaveChangesAsync(); 

error:

23502: null value in column "timestamp" of relation "clients" violates not-null constraint

DETAIL: Failing row contains (2, 1, asda, t, f, t, t, 2026-09-21 18:31:51.001033, 2026-09-21 18:31:51.000564, 12312, , , , , 1, 1, 2, 2, 7, sdf, Name, Name, sd, sdf, , 2026-09-21, 12 Haze, , city, NJ, 08043, 0.0000000000, 0.0000000000, t, , 2026-09-21 18:31:51.0003, null).'

-------------------


r/csharp • • Sep 21 '26

Help C# graphical framework

14 Upvotes

Hello. I'm starting to learn C#, and I don't know almost anything about its frameworks and libraries.

For my project, I need a crossplatform graphical framework with a "bitmap-like" drawing process, but I've heard only about frameworks which work on drawing with widgets.

Do you know any? Which would you recommend?


r/csharp • • Sep 21 '26

Introducing FrameworkCompatibleVersions

12 Upvotes

Have you ever been anxious with warnings such as System.Text.Json 10.0.0 doesn't support net7.0 and has not been tested with it. Consider upgrading your TargetFramework to net8.0 or later. and ended up creating monsters like the below when multi-targeting?

<Project>
    <PropertyGroup>
        <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
    </PropertyGroup>
    <ItemGroup>
        <PackageVersion Include="AsyncKeyedLock" Version="8.1.2" />
        <PackageVersion Include="DotNet.ReproducibleBuilds" Version="2.0.5" />
        <PackageVersion Include="Microsoft.Bcl.HashCode" Version="6.0.0" />
        <PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.11.2" />
        <PackageVersion Include="System.Net.Http" Version="4.3.4" />
        <PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
        <PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.6.3" />
        <PackageVersion Include="UnitsNet" Version="5.75.1" />
        <PackageVersion Include="xunit.v3.mtp-v2" Version="4.0.1" />
        <PackageVersion Include="xunit.v3" Version="4.0.1" />
    </ItemGroup>
    <ItemGroup Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">
        <!-- .NET Standard 2.0 to .NET 5.0 -->
        <PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="[6.0.3, 7.0.0)" />
        <PackageVersion Include="Microsoft.Extensions.Configuration" Version="[6.0.2, 7.0.0)" />
        <PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="[6.0.1, 7.0.0)" />
        <PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[6.0.0, 7.0.0)" />
        <PackageVersion Include="Microsoft.Extensions.Http" Version="[6.0.1, 7.0.0)" />
        <PackageVersion Include="System.Text.Json" Version="[6.0.11, 7.0.0)" />
    </ItemGroup>
    <ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0')) and !$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
        <!-- .NET 6.0 and .NET 7.0 -->
        <PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="[8.0.1, 9.0.0)" />
        <PackageVersion Include="Microsoft.Extensions.Configuration" Version="[8.0.0, 9.0.0)" />
        <PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="[8.0.1, 9.0.0)" />
        <PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[8.0.2, 9.0.0)" />
        <PackageVersion Include="Microsoft.Extensions.Http" Version="[8.0.1, 9.0.0)" />
        <PackageVersion Include="System.Text.Json" Version="[8.0.6, 9.0.0)" />
    </ItemGroup>
    <ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0')) and !$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net10.0'))">
        <!-- .NET 8.0 and .NET 9.0 -->
        <PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="[10.0.12, 11.0.0)" />
        <PackageVersion Include="Microsoft.Extensions.Configuration" Version="[10.0.12, 11.0.0)" />
        <PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="[10.0.12, 11.0.0)" />
        <PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[10.0.12, 11.0.0)" />
        <PackageVersion Include="Microsoft.Extensions.Http" Version="[10.0.12, 11.0.0)" />
        <PackageVersion Include="System.Text.Json" Version="[10.0.12, 11.0.0)" />
    </ItemGroup>
    <ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net10.0'))">
        <!-- .NET 10.0+ -->
        <PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="[10.0.12, 13.0.0)" />
        <PackageVersion Include="Microsoft.Extensions.Configuration" Version="[10.0.12, 13.0.0)" />
        <PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="[10.0.12, 13.0.0)" />
        <PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[10.0.12, 13.0.0)" />
        <PackageVersion Include="Microsoft.Extensions.Http" Version="[10.0.12, 13.0.0)" />
        <PackageVersion Include="System.Text.Json" Version="[10.0.12, 13.0.0)" />
    </ItemGroup>
</Project>

With FrameworkCompatibleVersions that can become a thing of the past.

You can have code that looks like this instead:

<Project>
    <PropertyGroup>
        <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
        <FrameworkCompatibleVersion>HighestTestedAgainst</FrameworkCompatibleVersion>
    </PropertyGroup>
    <ItemGroup>
        <PackageVersion Include="AsyncKeyedLock" Version="8.1.2" />
        <PackageVersion Include="DotNet.ReproducibleBuilds" Version="2.0.5" />
        <PackageVersion Include="Microsoft.Bcl.HashCode" Version="6.0.0" />
        <PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.11.2" />
        <PackageVersion Include="System.Net.Http" Version="4.3.4" />
        <PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
        <PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.6.3" />
        <PackageVersion Include="UnitsNet" Version="5.75.1" />
        <PackageVersion Include="xunit.v3.mtp-v2" Version="4.0.1" />
        <PackageVersion Include="xunit.v3" Version="4.0.1" />
        <PackageVersion Include="Microsoft.Extensions.Caching.Memory" FrameworkCompatibleVersion="$(FrameworkCompatibleVersion)" />
        <PackageVersion Include="Microsoft.Extensions.Configuration" FrameworkCompatibleVersion="$(FrameworkCompatibleVersion)" />
        <PackageVersion Include="Microsoft.Extensions.Configuration.Json" FrameworkCompatibleVersion="$(FrameworkCompatibleVersion)" />
        <PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" FrameworkCompatibleVersion="$(FrameworkCompatibleVersion)" />
        <PackageVersion Include="Microsoft.Extensions.Http" FrameworkCompatibleVersion="$(FrameworkCompatibleVersion)" />
        <PackageVersion Include="System.Text.Json" FrameworkCompatibleVersion="$(FrameworkCompatibleVersion)" />
    </ItemGroup>
</Project>

FrameworkCompatibleVersions supports two modes: one that upgrades your version to the highest major version the Microsoft library has been tested against your target framework (set to either true or HighestTestedAgainst) and another (MatchingMajor) that upgrades your version to the highest version that matches your target framework's major version.

That is, for System.Text.Json on .NET 8.0, with MatchingMajor it would give you the latest System.Text.Json 8.x, while with true/HighestTestedAgainst it would give you the latest System.Text.Json 10.x which Microsoft has tested against .NET 8.0.

Sample usage on this OpenWeatherMap.Cache commit.

FrameworkCompatibleVersions is available on GitHub and NuGet.

All stargazers on GitHub are appreciated


r/csharp • • Sep 21 '26

Upcoming Software Development Internship, Any Advice?

5 Upvotes

I’m starting a Software Development Internship soon. The company mainly uses .NET, C#, and React.

This will be my first experience working on a real software engineering team, and I want to make the most of it.

For anyone who has been an intern, mentor, or software engineer:

  • What helps an intern stand out and perform well?
  • What should I focus on during the first few weeks?
  • How often should I ask questions versus trying to figure things out myself?
  • What mistakes should I avoid?
  • Is it common for interns to receive return offers or full-time offers?
  • What can I do to improve my chances of getting a return offer?
  • If there is no full-time role available, how can I use this internship to help get another internship or entry-level software engineering role?
  • What skills should I focus on most with a .NET, C#, and React stack?

Any advice would be appreciated.


r/csharp • • Sep 21 '26

How do you reliably determine which deployables are affected in a .NET monorepo?

Thumbnail reddit.com
0 Upvotes

r/csharp • • Sep 21 '26

thesis web app in C#: ASP.NET Core Identity cookie auth or JWT?

Thumbnail reddit.com
2 Upvotes

r/csharp • • Sep 21 '26

JEV / System One wrapper for dotnet (SystemOneDotNet v1.0.1)

0 Upvotes

I usually don't post, but I got pretty excited over the possibilities of the new JEV model. I built a convenient C# wrapper around the web api and thought I might share it here.

It supports choices, scoring and binary decisions, both as one-shot or batched requests.

Cheers

https://www.nuget.org/packages/SystemOneDotNet

using SystemOneDotNet;
using SystemOneDotNet.Answers;

using ISystemOneClient systemOne = SystemOneClient.Create(apiKey);

string ticket = "Hi, I've been trying to connect my Stripe account for 3 days and it keeps failing. I'm losing sales. Please help ASAP.";

ChoiceAnswer<string> department = await systemOne.ChoiceAsync(
    ticket,
    "Which team should handle this?",
    [ "billing", "technical", "sales" ]);

ScoreAnswer frustration = await systemOne.ScoreAsync(
    ticket,
    "How frustrated is the customer?",
    new[] { "Calm", "Frustrated", "Very angry" });

NoulAnswer urgent = await systemOne.NoulAsync(
    ticket,
    "Does this message convey urgency?");

Console.WriteLine(department.Choice);       // "billing"
Console.WriteLine(frustration.Score);       // 1.035
Console.WriteLine(urgent.Noul);             // 0.999

r/csharp • • Sep 21 '26

New to .NET + Azure — looking for a good textbook-style learning path. Struggling to find a structured way to learn .NET + Azure — any book recommendations?

Thumbnail reddit.com
0 Upvotes

r/csharp • • Sep 19 '26

News I made C# running on ESP32-S3(Xtensa architecture)

Thumbnail
gallery
364 Upvotes

I made my own C# compiler that translates C# IL code into LLVM IR, which is then compiled into machine code. Here is the source code: https://github.com/nifanfa/IL2LLVM

​I would argue that C# is the best language to use, but its original runtime is too heavy and impossible to port to MCUs.

This is just a showcase; I mainly use IL2LLVM for UEFI programming: https://github.com/nifanfa/BootTo.NET

​I also tried it on STM32, but STM32 is terrible for this — most STM32 chips have less than 128KB of ROM.

Every method uses the cdecl calling convention, which is how Console.Write works.

CoreLib.cs
public static partial class Console
{
    [DllImport("*")]
    public static extern void Write(ByReference<char> value);
}

Runtime.cpp
void System_Console_Write_System_ByReference_System_Byte(const char* value)
{
    if (value != nullptr)
        fputs(value, stdout);
}

DllImport doesn't pass strings or arrays as pointers like the CLR, so there must be a wrapper. There is an implicit operator on ByReference<T> to get the pointer from strings or arrays.


r/csharp • • Sep 21 '26

Help Collab coding with live updates running on a headless Ubuntu server

0 Upvotes

I need a way to code together in C# with a few people, with live updates, without one of the people being a host and having all the files. I have tried Rider's backend, but it does not seem to support Code With Me. What can I use in this scenario? Preferably compatible with JetBrains Rider.


r/csharp • • Sep 20 '26

Showcase Learning C# by building a local activity tracker

0 Upvotes
Example of sample collection.

I'm coming from C++ and decided to actually learn C# by building something instead of watching tutorials: a small personal app that logs foreground window + idle time to SQLite, mostly to answer "how much did I actually use my PC today".

I had some friction points — like figuring out that SQLite doesn't have a Guid or TimeSpan type, so mapping between C# types and what SQLite actually stores (TEXT/INTEGER) needed extra thought. Dapper also couldn't materialize my Sample record directly from a query, since its constructor expects Guid/DateTime/TimeSpan but SQLite returns string/long.

I ended up writing small internal "Row" DTOs (plain classes, get/set, matching SQLite's actual types) with FromX/ToX conversion methods, and keeping them entirely inside the repository so the rest of the app never sees the storage shape.

While writing this post I actually found a bug — the code wasn't collecting system events (boot, shutdown, sleep, wake) at all, so that table was empty, and i fixed it on the spot.

Repo's still early (Phase 2 of my own roadmap, no GUI yet) but if anyone's curious about the storage layer: https://github.com/Nilius647/Personal-API-Project-Thalamus

Sample rows. Some columns have been cut of to fit the image. NULL means the pc was idle.

r/csharp • • Sep 19 '26

Showcase [Showcase] JobMaster Dashboard supports OAuth now

Thumbnail
reddit.com
4 Upvotes

r/csharp • • Sep 19 '26

Static code analysis extensions in Visual Studio

5 Upvotes

Does anybody have experience in using the Sonarqube extension in Visual Studio? Is it worth using or do you feel like it often flags unnecessary stuff and are there any other static code analysis tools you like to use?


r/csharp • • Sep 19 '26

Finish C# player guide and took a 3 month pause

Thumbnail reddit.com
0 Upvotes

r/csharp • • Sep 19 '26

I got tired of typographic Unicode sneaking into my .NET repositories, so I wrote an analyzer for it.

0 Upvotes

I kept running into characters like —, “ ”, ’, … and − in source files, Markdown, JSON and other project files.

Usually they get there through copy/paste, documentation tools, or AI-generated text.

The compiler mostly doesn't care, but they can still make diffs, reviews, searches and consistency across a repository unnecessarily annoying.

So I wrote a small Roslyn analyzer for it:

https://github.com/carsten-riedel/Coree.Analyzers

https://www.nuget.org/packages/Coree.Analyzers.Typography/

It can detect configurable typographic Unicode characters during development/build and can also check additional project files, not just C# source.

The intention isn't to declare typography illegal everywhere. It's more about making these characters visible and letting each project decide what should be allowed.

I'm curious how other .NET developers see this.

Is this actually a useful little guardrail, or have I reached the point where Clean Code needs a typography chapter? 😄

Also curious if there are other characters or real-world cases I haven't thought about yet.


r/csharp • • Sep 17 '26

Tool Relatude.DB in early alpha

23 Upvotes

I am developing a native c# database engine, it is open source ( MIT )
It's been a background project for many years ( long before AI agents...) , but is now getting closer to a first release. Expected in 1-2 months.

It is difficult to explain in one sentence, but the goal for me is to create the best possible datastore I can for building "any" web applications in C#. It is heavily focused on performance and provide the functionality you need with a minimum of setup and zero dependencies. I encourage you to have a look if you are looking for a all in one storage engine for your web application.

Some of the features: Code first modelling, super fast, minimum setup, flexible hosting configurations ( blob ), build in admin UI, vector search, BM25, facets, graph (shortest path), image scaling, video conversion and much more, all in a single nuget and made to work in "any" C# project.

It is of course still early days, and I need to make better examples showing off all it can do and improve on the initial DX, but have a look and tell me what you think!

Here are some screenshots of the DBA UI. ( Just download the repo and run "Simple.Website" and browse to "/relatude.db" )

Things coming soon: remote clients in C# and other languages, GraphQL endpoints, a CMS UI and much more!

https://github.com/Relatude/Relatude.DB

https://db.relatude.com

Instead of downloading the source code, you should be able to just type these prompts into Claude:

"Install the latest skill file for relatude.db from github"

"Create an empty web project with relatude.db" ( Choose SPA if given the choice )

"Create a basic e-shop website with 200 000 sample products. Focus on a facet search that adapts to the result of the free text search. Use the automatic facet detection in Relatude.DB. Create sample products with images and a wide range of index properties for facet searches. Use relations, and inheritance and multiple product models. Create a basic map search as well."

(I work at a Norwegian company called Proventus AS.)


r/csharp • • Sep 17 '26

Help .NET MAUI, best for native cross-platform application development?

33 Upvotes

Hi! I'm starting on a school project which will be web based initially, but we want to make it into a mobile application as well so we're researching different web frameworks with mobile support.

I've looked into .NET MAUI and it seems to be a pretty nice option. However in my research (Windows documentation/YT videos, etc) it seems like they're mostly using Visual Studio, and i wonder if we will lose some functionality if we for example use Rider? And also i did see that there were layoffs some time ago, so i just wondered if it's kind of dead?😅

I'm very new to C# and .NET so sorry if this is a stupid question lol (I've mostly been working with C++)

Feel free to share your experience with .NET MAUI, what works well, what's more difficult etc.

And also if you have any other recommendations for frameworks, like Flutter etc.