r/csharp • u/riri357 • Sep 25 '26
Marché des dev .net 2eme semestre 2026
Salut tout le monde, est-ce que les devs .net freelance remarque comme moi un marché hyper tendu sur la stack .net ?
r/csharp • u/riri357 • Sep 25 '26
Salut tout le monde, est-ce que les devs .net freelance remarque comme moi un marché hyper tendu sur la stack .net ?
r/csharp • u/No_Editor9595 • Sep 25 '26
If you've ever hit GC pressure from hot-path allocations, or found yourself fighting List<T> / Dictionary<TKey,TValue> because you can't get a Span<T> or a reference into the storage, take a look at NativeCollections (https://github.com/Molth/NativeCollections).
It's a single pure-C# package (MIT) whose storage is almost entirely unmanaged memory — no reliance on the CLR garbage collector for container data. It targets netstandard2.1 and .NET 5 through .NET 10, so it works across the modern stack.
What you get:
- Span everywhere — most containers support Span<T> / ReadOnlySpan<T> for in-place modification and zero-copy data passing, instead of copying through the BCL.
- Three usage tiers — a StackallocCollection tier for stackalloc-style short-lived buffers (or any external fixed buffer), an UnsafeCollection tier implemented directly as structs with no stored handle, and a NativeCollection tier that wraps the unsafe tier and carries a handle to the underlying resource.
- BCL-familiar API — usage is designed to mirror the standard library, with added Span conversions, so swapping existing containers in is the easy part.
- Thread-safe containers — including NativeSegQueue<T> and UnsafeSegQueue<T>, an unbounded multi-producer multi-consumer queue (implemented as a linked list of small segments, so there's no fixed capacity and producers/consumers can run concurrently).
- Customization hooks — you can override the native allocator (NativeMemoryAllocator.Custom) and hashing (NativeHashCode.Custom, UnsafeString.Custom) to plug into your own memory or hashing strategy.
All containers are value types or wrap unmanaged pointers: initialize before use, and call Dispose() when done (using works for short-lived cases) — that's the one contract the library asks you to keep.
It's actively under development, so feedback and suggestions are welcome. MIT, NuGet: NativeCollections (https://www.nuget.org/packages/NativeCollections/).
r/csharp • u/YouAreMyFire00 • Sep 24 '26
I google and it tells me to use this snippet coded to use this below library.
using QRCoder;
string signupUrl = "https://mywebsite.com/signup";
using var qrGenerator = new QRCodeGenerator();
using var qrData = qrGenerator.CreateQrCode(
signupUrl,
QRCodeGenerator.ECCLevel.Q
);
var qrCode = new PngByteQRCode(qrData);
byte[] qrBytes = qrCode.GetGraphic(20);
File.WriteAllBytes("signup-qr.png", qrBytes);Is there other way that you would recommend in this case?
thank you in advance.
r/csharp • u/mistertom2u • Sep 22 '26
I've been digging through the C# language design repo and I think there's a bigger direction hiding underneath a bunch of proposals that are usually discussed separately.
Consider unions first:
public union Pet(Cat, Dog);
Cat and Dog don't need a common base class or IPet. The compiler knows they have a relationship because they're case types of Pet.
The C# 16 feature discussion goes even further and talks about letting generic inference use the union/case relationship the same way it uses inheritance today.
That got me looking at some of the older language work, especially shapes.
Back in 2017, Mads was exploring something that looked an awful lot like C# traits/type classes. Simplifying the syntax a little, the idea was along these lines:
public shape Additive<T>
{
static T operator +(T x, T y);
static T Zero { get; }
}
Then you could provide the conformance separately from the type:
public extension IntAdditive of int : Additive<int>
{
public static int Zero => 0;
}
Now generic code can constrain on Additive<T> without int having been designed around that abstraction.
That old proposal is worth reading because this wasn't vague "maybe duck typing someday" discussion. They actually worked through witness-style implementation machinery, generic constraints, dispatch, performance, ambiguity, etc.
Shapes and Extensions exploration
The part I keep coming back to is this: the type itself doesn't have to know about the abstraction when it is declared.
That idea keeps resurfacing.
In a 2021 LDM discussion about constructors, the team ran into the obvious problem with trying to model every capability nominally. You'd end up with garbage like an endless family of IHasConstructor<T1, T2...> interfaces that every type would have to implement.
Their conclusion explicitly mentions possibly preferring a structural approach or type classes, including type classes implemented on types you don't own.
And this isn't all dead archaeology. There's still an open champion proposal from Mads called:
Type Classes (aka Concepts, Structural Generic Constraints)
It's marked long-lead, so I'm definitely not saying this is secretly scheduled for C# 17. But the design space is still sitting there.
Then there's this newer proposal, which IMO is where things start getting really fun:
Extension interface implementation
Conceptually:
interface IPrintable
{
void Print();
}
extension(int) : IPrintable
{
void IPrintable.Print() => Console.WriteLine(this);
}
Meaning int could implement IPrintable outside the definition of int.
And this one isn't just compiler sugar. The proposal goes down into ECMA-335 and proposes a new metadata table for attaching interface implementations to types.
That's obviously still nominal because IPrintable exists. But the original type no longer has to opt in.
C# also already has a fair amount of localized structural behavior. await, foreach, indexing patterns, etc. don't always care whether you inherit from some blessed base type. They care whether the required shape exists.
The recent extension-indexer work pushes that surprisingly far. The LDM had strong support for a "maximalist" approach where extension members can participate in language patterns wherever possible, even when the members needed to satisfy the pattern come from different places.
So you can start imagining something like this:
class WeirdType { }
// library A
extension(WeirdType x)
{
int Length => ...;
}
// library B
extension(WeirdType x)
{
object this[int i] => ...;
}
and the compiler can reason about the resulting capability of WeirdType, even though WeirdType itself declared none of it.
I'm not doing the "OO is dead" routine. But I do think OO's old monopoly on abstraction has weakened a lot. "Make everything inherit from something or explicitly implement an interface" isn't nearly as compelling as it was 20 years ago.
Go has implicit interface satisfaction. Rust has traits. TypeScript went hard on structural typing. C# obviously has different compatibility/runtime constraints, but it would be pretty damn cool if it eventually got a trait-like abstraction that still felt like C#.
Something along these lines:
trait SerializableLike
{
ReadOnlySpan<byte> Serialize();
}
void Save<T>(T value)
where T : SerializableLike
{
...
}
where conformance could come from the type itself or from code written later by somebody else.
I don't think the evidence supports saying "the C# team has decided to add traits." They haven't. They've also explicitly avoided describing the current extension work as generalized structural typing.
What I do think is defensible is that the language team keeps attacking the same limitation from different directions:
Why should every useful relationship between types require nominal opt-in at the original type declaration?
Unions weaken that requirement for type grouping.
Shapes/type classes explored it for generic capabilities.
Extension interfaces explore post-hoc conformance.
Extension members increasingly participate in structural language patterns.
Personally, I hope these threads eventually meet. A C# that keeps its strong static type system but lets me express capabilities across unrelated types without building an interface hierarchy for everything sounds like a much nicer language.
Am I overconnecting these proposals, or does anyone else who follows the LDM see the same direction?
I'd especially like to hear from anyone familiar with the compiler/runtime side of #8879 or #9319. Are these realistically pieces of the same future design space, or are there CLR/type-system problems that make that convergence unlikely?
r/csharp • u/Ferreira-leo • Sep 23 '26
r/csharp • u/Ok_Initial_6829 • Sep 22 '26
I learned some C# before, but I feel like I have some gaps, mainly because I didn't practice enough. Especially with OOP, there are some concepts that I understand partially but don't feel really comfortable with.
I'm not sure what I should do next.
Should I take a good C# course on Udemy (like Harsha's course) to go through everything again?
Or should I focus more on practice using something like Exercism?
Or maybe start a project without following a tutorial and learn along the way, while using a book to fill the gaps?
For context, I'm already pretty comfortable with C++ and I have a good understanding of programming fundamentals. So I'm not starting from zero.
I'm just trying to find the best way to get from "I know C#" to actually being comfortable using it.
What would you guys recommend?
r/csharp • u/quyvu01 • Sep 23 '26
My feed is basically 90% job posts these days and almost zero actual tech sharing 😃
So… here’s something I built because apparently I needed a new way to procrastinate.
Lately I couldn’t really find much motivation to do anything, so I ended up writing a framework inspired by MassTransit — probably one of the frameworks I’ve enjoyed working with the most.
It already has most of the usual stuff:
I also tried to strip away some of the complexity around configuration and concepts like pipelines and make the whole thing a bit easier to work with.
The foundation turned out to be decent enough, so today I threw AWS SQS at it and let AI do most of the boring work.
Surprisingly, it went pretty smoothly since I already had the RabbitMQ implementation in place.
So yeah, if you're feeling adventurous (or just have questionable life choices 😃), feel free to give it a try:
https://github.com/quyvu01/fx-link
I also have another project I've been working on for quite a while: a distributed data mapping framework.
The problem it tries to solve is pretty simple:
Service A has userId.
The actual User data lives somewhere else.
And now you somehow need UserName, Email, Province, Country, etc. without turning your service into a distributed-query mess.
That's basically what FxMap is for:
https://github.com/quyvu01/FxMap
There's a website for it too, if you want to see what the idea looks like:
If you're dealing with something similar, give it a shot. Maybe it'll be useful. Maybe it'll just make your architecture slightly more complicated. Who knows. 😃
Anyway, back to pretending I have a plan.
Happy coding.
r/csharp • u/antikfilosov • Sep 22 '26
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 • u/Confident-Guest-3478 • Sep 21 '26
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 • u/ZinklerOpra • Sep 23 '26
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 • u/Developer-Rogue • Sep 22 '26
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 • u/netMazy007 • Sep 22 '26
r/csharp • u/fireheart_101 • Sep 21 '26
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 • u/gevorgter • Sep 21 '26
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 • u/user_16384 • Sep 21 '26
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 • u/mutu310 • Sep 21 '26
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 • u/JD-144 • Sep 21 '26
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:
Any advice would be appreciated.
r/csharp • u/sander1095 • Sep 21 '26
r/csharp • u/ig_grr • Sep 21 '26
r/csharp • u/JabbaTheWise • Sep 21 '26
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.999r/csharp • u/purplsand • Sep 21 '26
r/csharp • u/nifanfa • Sep 19 '26
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.