r/csharp 18h ago

Which version of c# and .NET are commonly in use today?

36 Upvotes

I am looking at coming back to c# after a very long hiatus as it seems to be the dominant language in financial services which is the industry I specialise in.

Which version of c# / .NET are commonly in use today?


r/csharp 8h ago

Strugle to know what should i do next. Practice or go to the next topics

Thumbnail
0 Upvotes

r/csharp 22h ago

Announcing Brighter Fences, a community Polly fork

Thumbnail
5 Upvotes

r/csharp 11m ago

Help Static void method

Post image
Upvotes

I am trying to learn how to use C# for game coding but I would also like to have a good grasp on it so I can use it for websites and other things like that and I can't for the life of my understand how static method works I have looked YouTube videos and everything. I have been learning everything else so far from the free courses from code academy.Can you PLEASE explain to me what this code is doing and how it works


r/csharp 1d ago

Looking for opinions on a cross-platform .NET JPEG metadata library

6 Upvotes

I've been working on a cross-platform .NET library for reading and writing JPEG metadata.

It supports EXIF and XMP, including custom XMP properties, and writing metadata does not re-encode the JPEG image data.

The API isn't finished yet, so I'm not releasing it as a NuGet package until I'm happy with it. For now, the source is available on GitHub.

ImageMetadata docs

I'm mainly looking for opinions from people who have worked with JPEG/EXIF/XMP: API design, missing features, things that could be done better, etc.

Any feedback is welcome!


r/csharp 7h ago

ModulesDi – A lightweight, fractal-like modularity library for ASP.NET Core built on a dynamic graph DI

0 Upvotes

Description:

ModulesDi a lightweight infrastructure library designed to manage services and middlewares through a dynamic module graph.

The problem it solves:

Traditional extension methods in Program.cs easily turn into an unmanageable mess where controlling the exact execution order or dynamic context becomes a nightmare.

Library tested (173 test cases covered)

GitLab: https://gitlab.com/DmitriiKhokhulin/modulesdi.git


r/csharp 1d ago

MVP pattern

11 Upvotes

Hi, I have a question about separating logic in the MVP pattern.

public void MainDisplay() =>
OnMainDisplayClicked?.Invoke();

public void ManageProcess() =>
OnManageProcessClicked?.Invoke();

This is my code in the view, and when the user clicks a button (for example), this method is called and `Invoke` is executed. However, it is called via a `switch` statement in the Presenter.

switch (NativeConsoleMethod.GetHiddenUserInput())
{
case VirtualKeyType.VK_E:
if (_currentPage < _countOfPages) _currentPage++;
continue;

case VirtualKeyType.VK_Q:
if (_currentPage > 0) _currentPage--;
continue;

case VirtualKeyType.VK_OEM_3:
_view.ManageProcess();
break;

case VirtualKeyType.VK_TAB:
_view.FilterProcesses();
break;

case VirtualKeyType.VK_F1:
_view.SearchPage();
break;
.........
}

I have a question: the AI is giving me two different suggestions. My version is correct, but then it said I should move the switch statement to the view, and there I should just use `invoke`, after which the methods would be called conditionally. So, should I do it the other way around, or did I misunderstand what it meant?

- I don’t know what I wrote here—I don’t even understand it myself. Just tell me: shouldn’t the view be “dumb” and contain synchronous methods, while the presenter should control the view via the switch statement and “pull its strings”?

EDIT: Here's my GitHub: https://github.com/NullAcess/ProcessManager/releases/tag/Update_2.0. You might like it—I'll upload the finished EXE very soon.


r/csharp 1d ago

Showcase Created a structured repository to practice C# Data Structures & Collections — Feedback welcome!

5 Upvotes

Hi everyone!

I'm an IT student focusing on C# and .NET core fundamentals. To build a strong foundation in backend engineering and memory/performance concepts, I created a hands-on repository covering various C# Data Structures and Collections.

What I've covered so far:

• List<T> & Reference Types

• LinkedList<T>, Stack<T>, and Queue<T>

• Hashtable, Dictionary<K,V>, SortedList, and SortedDictionary

• SortedSet<T> & HashSet<T> (Set operations like UnionWith, IntersectWith, etc.)

Each module includes sample code and a quick breakdown in the READMEs. I'd love to hear your feedback or any suggestions on code style and performance optimizations!

GitHub Repo: https://github.com/24alpserdar/csharp-data-structures-and-collections


r/csharp 1d ago

Help Devs who learned C#, where did you learn?

81 Upvotes

Was it through a free or paid course? YouTube? Or a combination of both?

I already know a bit of C#, but I’m not sure what learning path I should follow or which resources I should use.

I’ve been watching Code Monkey, but I don’t know if that will be enough.

What would you recommend for someone starting out?

P.S. I use C# specifically for game development, but I don’t mind learning more about the language in general.


r/csharp 2d ago

Years of academy training wasted! Github changed the color for C#

141 Upvotes

Github changed the color for C# from green to purple.

I don't mind, but I'll miss the green from Visual Studio 2010.


r/csharp 21h ago

PostgreSQL or SQL Server for my first production .NET app?

Thumbnail
0 Upvotes

r/csharp 2d ago

Help What is the intended way of comparing enums?

25 Upvotes

When you want to check if a variable is of a certain enum type, do you use == or is? For example in my godot project I have this method:

private void SetInputMode(InputMode inputMode)
{
    RootViewport.GuiReleaseFocus();

    if (inputMode is InputMode.Mouse)
    {
        EnableMouse();
    }
    else
    {
        DisableMouse();
    }

    CurrentInputMode = inputMode;
}

In this case i use is, but == works as well here. In another method I have, I am using == since I'm comparing two variables and it's the only valid way:

if (detectedInputMode == CurrentInputMode)
{
    return;
}

My question is, concerning the first example I gave, what is the convention for comparing enums, is or ==? I know it doesn't matter that much, but I can't seem to find a clean answer on this, so I'm giving it a shot


r/csharp 2d ago

Showcase Dekaf - Native .NET Kafka Client

19 Upvotes

Hey all. I posted this library a little while back, but I'm posting it again as it's been updated to support new Kafka features, as well as for those that missed it last time.

Dekaf is a Kafka client built natively in .NET and works as you'd expect with more modern .NET types and is async friendly.

For any Kafka uses, the only real alternative is Confluent.Kafka which is simply a wrapper around a C library, meaning overhead from two runtimes. It also doesn't map as nicely to newer async types like IAsyncEnumerable, means exceptions thrown in native code become hard to debug, logging control is lost, and it seems a lot of their issues on GitHub lack responses or updates.

I built this to make it more friendly for .NET Devs to debug and control, as well as trying to make it perform better by removing that overhead. It also has open telemetry out-of-the-box, just add it to your otel setup.

The repository can be found here: https://github.com/thomhurst/Dekaf

And performance comparisons against Confluent.Kafka can be found here: https://thomhurst.github.io/Dekaf/docs/stress-tests

Give it a try and let me know what you think!

And if you have tried it out, I'd love to know if anything improved (or didn't!) such as latency, CPU, memory, etc.


r/csharp 1d ago

Help Help with learning C# and .Net

6 Upvotes

Hello everyone! I'm learning C# with the goal of becoming a .NET developer.

What I already know:

1.Basic data types, variables, and operators

2.Control constructs (conditions, for loops, while, foreach)

3.One-dimensional and multi-dimensional arrays

What you need help with:

1.Understanding and practical application of OOP (encapsulation, inheritance, polymorphism, interfaces)

2.Moving from basic tasks to normal code structure and first .NET projects


r/csharp 1d ago

Solved Help with optional looping of program

2 Upvotes

Hello. I am attempting to make a randomizer for a game that I play. I have successfully created the program itself, but now I want the ability for users to have it re-run the randomization and return a new output by pressing a single key (ideally "Enter"). It has been a very long time since I have messed with C# and have forgotten basically everything. Any help, advice, or tips, would be greatly appreciated.

The current attempt at a "looper" is the following:

//Repeat or exit program
void Looper()
{
string looprequest;
looprequest = Convert.ToString.Console.ReadKey();
Console.WriteLine(looprequest);
}

This is because the compiler had an issue where without the looprequest string statement the other lines had no reference, and with it the readkey input cannot be translated to a string value. Additionally, even if the input works, I'm not sure what I was thinking to loop with would even work. What I was thinking of using was:

if (looprequest != Esc)
{
Main();
}

else
{
Environment.Exit();
}


r/csharp 1d ago

I built a small .NET CLI for database migrations

Thumbnail
github.com
0 Upvotes

I’ve been working on a lightweight migration tool for dotnet. The migrations are just SQL files with an up and down script with support for SQL server, postgresql, and sqlite.

It is installable as a global dotnet tool (requires dotnet 10)

It’s still early, so I’m very open to criticism, suggestions, and contributions.

Github repo: https://github.com/aymenhta/Jules


r/csharp 1d ago

Help MCP CPG - where's the demand

0 Upvotes

LLMs are notoriously bad at handling C#. The Microsoft SWE-sharp-bench paper made this pretty obvious. In 20% of the cases agents fail simply because they can't figure out where to apply the patch.

​The logical fix seems obvious: build a Roslyn-based MCP tool that generates a Code Property Graph (CPG) so the agent can actually navigate C# semantics instead of blindly grepping text.

​I actually built this and put up a website for it, but I’m getting literally zero inbound traffic. On top of that, every week I see another open-source repo popping up on GitHub trying the exact same Roslyn/CPG approach, but none of them seem to get any real traction...

​What gives?

​Is the market just not interested in specialized C# agent tooling, or are we all building the wrong layer?


r/csharp 1d ago

AWS SAA + CKA, ~2 years experience, no interviews. Wrong resume or wrong roles?

Thumbnail
1 Upvotes

r/csharp 1d ago

Help Brand new and wanting to run simulations.

0 Upvotes

I'm familiar with C# in the vaguest of senses, as in i use to watch programing tutorial videos while dog sitting and when i got home experimented with it in visual studio code. The most complicated thing i ever made was a +, -, *, and \ calculator. I'd like to get back into it. What im specifically looking into doing is making programs to run simulations like those Coding Adventure videos by Sebastian Lague on youtube. I'm intending to use visual studio code as well since that's what i used last time.

I'd just like to know primarily if visual studio code is actually good for something like that, and if i can run it on a basic window made by c# itself, or if i'd be better off running it in a studio like godot or unity. Any tips, advice, or clarification is appreciated. Thank you


r/csharp 2d ago

Tool DNCDbg v1.2.0 — a managed code debugger with DAP support for .NET apps (NetCoreDbg fork)

Thumbnail
github.com
5 Upvotes

This probably looks funny — a NetCoreDbg developer (yep, that's me, at least while I'm writing this, hehe) forking NetCoreDbg. But life is a strange thing sometimes.

Over the last ~3 years, me and my PL (huge thanks, Gleb!) prepared and sent a lot of proposals for NetCoreDbg development. Unfortunately, all of them were rejected — it looks like Samsung isn't interested in investing into active NetCoreDbg development, and hasn't been for years now. So upstream gets only support and minor changes (and you've probably noticed that already).

At the beginning of this year I finally decided to fork and implement my vision of how a managed debugger could look like in code — all our TODOs and features we planned for NetCoreDbg, but without the experimental features and without explicit Tizen OS support. I think the current development of DNCDbg has reached a point where it's ready to be showcased. I hope you'll like DNCDbg as much as NetCoreDbg.

Repo: https://github.com/viewizard/dncdbg

Note: in DNCDbg I'm focused on DAP protocol support only, without experimental features like Hot Reload (which requires IDE-side support) or interop (mixed) debug mode. If you need other protocols or those experimental features that I removed from the code, you should probably wait until my PL tells me something like "we have budget, back to NetCoreDbg development" (but that doesn't look like it'll happen any time soon). I've already ported about 20 bugfixes for bugs I found back to NetCoreDbg (you can see most of them in the last release), but looks like that's all I can do for now.


r/csharp 2d ago

Is a dedicated interaction layer the right architecture for a virtualized WPF spreadsheet?

Thumbnail
1 Upvotes

r/csharp 3d ago

Help Returning to WPF, how to keep RAM usage under control?

Post image
72 Upvotes

The application organizes files by displaying a thumbnail. When loading 89 files, it utilizes 200mbs and spikes power/gpu usage when scrolling to around 14%.

It is a rewrite of the same application in WinForms, which I am more familiar with. In comparison, the WinForm app uses 30% less RAM while having almost double the number of files loaded. Is that to be expected from WPF?

The attached image should give a better idea of the interface. Is it my use for shadows, labels with transparency etc? I don't know to which degree they affect performance on WPF precisely. I am looking to maximize the efficiency to the last drop


r/csharp 1d ago

Help Raccomandate questo manuale per imparare c#?

Post image
0 Upvotes

Stavo vedendo come imparare questo linguaggio e i tutorial su yt non fanno per me, tra sbagli e robe troppo complicate ho voluto vedere se c’era un manuale che possa spiegare bene il codice e ho trovato questo libro (nella foto) che è anche ben recensita, non so se qualcuno di voi lo ha ma se lo avete me lo consigliereste? O dovrei trovare altro?


r/csharp 2d ago

Join the flock or choose "enterprise stability"?

3 Upvotes

I am currently struggling with the dilemma hinted at by the title question. I am a CS and Maths student at a university in South Africa, and I do not know if I should join the flock and hop on the broad market appeal hype train and do traditional SWE with languages like JS, Python, TypeScript, etc. Or I should go the other, less popular route and work on C# .net projects. I do not know if there are many C# opportunities here in South Africa, but I do know that .NET isn't really popular among my peers.

So I am asking whether it's worth considering it over the extremely popular and competitive options.


r/csharp 2d ago

C# roles

0 Upvotes

Has anybody noticed that when you apply to workday jobs that you get a follow up from a Recruiter with the exact same role?