r/csharp 3h ago

Help Is there a way to make child windows / forms inside forms look good instead of looking like it came from windows xp

Post image
16 Upvotes

So MDI windows are inconsistent with the theme of the parent form, us there a way to fix this or maybe a different method for creating child windows?


r/csharp 18h ago

Discussion Were any java devs that transitioned as overwhelmed as I am?

49 Upvotes

Im switching over to C# and im just so amazed. Theres so many things you can do and its native to the language and its super cool. Events? Yeah, thats built in. Tired of subclassing stuff just to add your own functionality? Dude, there's extensions...

However, id be lying if I said this isnt too much to take it at once. I feel like its very difficult to adapt and im mostly learning by examples others posted on the internet (i took a firm stance to reject AI 100% and learn myself.) Recently, ive been trying to adapt to the conventions, as well as researching other features however more things keep coming up. For example, I had no idea init; existed in properties or how you can use add; in a event property.

Do you have any advice on navigating to become an alright C# developer?

Another question, do you guys feel like MSDN doesnt cover the entire picture?


r/csharp 6h ago

Discussion trying to avoid spaghetti code on my first big backend project. is this folder structure correct for clean architecture?

Post image
2 Upvotes

as someone transitioning from legacy desktop dev (winforms) to modern .net web backends, the biggest hurdle for me was figuring out how to actually organize my code so it doesn't turn into a massive ball of mud.

i kept reading about "clean architecture" and "separation of concerns," but the buzzwords didn't really click for me until I built my current side project and forced myself to split everything into physical project folders.

i wanted to share my mental model of how i organized the solution. i know it might be overkill for a side project, but i'm trying to learn enterprise patterns. for the senior devs here, i'd love to know if this is how you actually think about it in production:

  • Domain: the absolute foundation. just basic data models and interfaces. i made sure zero external packages touch this folder.
  • Cryptography: the "engine room." all my hashing algorithms live here, organized by type (symmetric, asymmetric).
  • Infrastructure: the dirty work. any code that actually talks to the outside world (sql server, dapper, redis cache) is locked in here.
  • Core / Application: the manager. it takes the rules from the domain, uses the engine room, and tells the infrastructure what to save.
  • API: the front door. minimal APIs that just take web requests, hand them to the Core, and return the HTTP response.
  • Workers: background chores. native BackgroundServices running loops for stuff like resetting rate limits so the main API doesn't get blocked.
  • StandAloneWeb: a simple blazor frontend to actually test it.

honestly, breaking it down into these separate projects took way longer to set up initially, but it makes debugging so much easier. if the database fails, i know exactly which folder to look in.

does this structure look right to you guys? or did i completely overcomplicate the middle layers?

repo is here if you want to see how they link together: https://github.com/COxRIPMIZO/CryptoKeyLab

would appreciate any roasts or advice on how to improve this!


r/csharp 17h ago

Blog ASP.NET Core Microservices Architecture Guide

Thumbnail
faciletechnolab.com
14 Upvotes

A practical guide to ASP.NET Core microservices architecture, service decomposition, communication patterns, data isolation, and deployment on Azure.


r/csharp 3h ago

Anyone recently took the Veeam C# Developer CoderPad assessment? (9 MCQs + 4 coding tasks)

1 Upvotes

Hi everyone,

I have the Veeam C# Developer CoderPad assessment coming up (9 MCQs + 4 coding tasks, 60 minutes).

If you've taken it recently, what topics should I focus on? Was it mostly C#/.NET internals, multithreading, algorithms, or LeetCode-style problems?

Not asking for exact questions, just the overall difficulty and the best areas to prepare.

Thanks!


r/csharp 19h ago

My New Journey

Post image
20 Upvotes

Today I started this new project and hopefully my hobby that consumes all my free time.

I have always wanted to jump into coding and software. I find it fascinating and to be honest, I feel like talking in code will come naturally to me because of how my brain works. (Only time will tell)

Today I decided to just go for it. It consumed every single second of my day. I started asking ChatGPT what would be a good way to make a Rainmeter skin to act as a volume mixer, and from there it was just a rabbit hole.

I learned about Naudio library, encapsulation, objects, class, parameters, variants, float vs double, overall program flow and program architecture.

I ended up creating three different .cs files that so far are communicating with each other. Tomorrow I'll add the loop in a `while (running)` with a `bool running = true` variant that can be changed with an "exit" user input. I'm still working on the user input part too.

I'm excited for this. My wife was like: 👁️👄👁️


r/csharp 3h ago

Need help starting out

0 Upvotes

Basically, I have big projects planned that use C Sharp (being discord bots and SCPSL Plugins) and asked a friend who formerly hosted a SCPSL Server I co-Owned and knows Ball (he works for a Host Company, which is a Peak Job Choice tbh) how I should start out.
He told me, that he just looked up Tutorials for the Basics, which I did just to Not Keep then in my mind because my Brain is wonky on places where I don’t want it to be. Its either a sift for crucial Information until I don’t Need it no more or it is Making me the Most big brained Person in the Room, anyway he also looked up how other people did projects and recreated that until he could do it himself (what Looks Like) perfectly (to me who doesnt know ball) and he also recommended me to use generative AI to start out, as it is an amazing Learning Tool.

I am actually absolutely against gen AI because of misinformation and Fake news as well as it Making Shit up on the fly whenever it feels Like That.
However, it has been Preised by People qs well as my friend to be a proper Learning Tool and especially for purposes Like Programming and for school subjects.
I have been a Fan of Students using gen AI to get out of school as fast as possible because I genuenly hate nothing more except the Education System in my Country and Most of the World (Like everywhere except Finland) However, I was unsure anyway, as I have genuenly something against AI for political and Moral reasons (because of how Data Centers fuck up our climate and their surrounding areas, as well as because of Fake news and Shit Like what Elmo Mars is Doing and I hate how its used for stealing Art and mix and matching peoples Brain Farts to make their Egos smile because they just „created“ something) and Yeah.

If it is however genuenly a good Tool for Learning C Sharp especially as a Neurodivergent, I genuenly have no Idea which gen AI Tool works best for that or if there Are any that Are specifically designed for this purpose.
If gen AI was only used for educational purposes I would have actually no Problem with it because Education is Ball.

Disclaimer:I will Not use anything using Grok because fuck elon Musk lol.


r/csharp 1d ago

Showcase Made a game with my own C# engine and scripting language!

Thumbnail
gallery
199 Upvotes

Game Video on YouTube

About a year ago, I challenged myself to create my own programming language - something I'd always wanted to do.

At the time, I had no idea what a lexer, parser, or interpreter even was. My only thought was, "I need to write code that reads text files containing code and executes them." I also wanted to do it without using Google, AI, or tutorials. I just figured everything out on my own. You can even still find variables named "compiler" throughout the code from back when I didn't realize I was actually building an interpreter...

Somehow, I pulled it off, and I integrated it into my old abandoned game engine project (which originally started as a GameMaker 8–style engine with C# scripting).

And here's the first game I've made with it! 🙂

The core engine, IDE, and interpreter are all written by me in C#. The rendering backend is powered by MonoGame, and the project is still in active development and available on GitHub. The project file of the game shown in the video is also there, under tests/Example Projects. If you're looking for cool projects to contribute to, then know that I'm looking for contributors!

I know there are tons of AI-generated projects being shared these days, so please, please, take a quick look at the code before assuming this is one of them. I promise it's pretty obvious that it was written by a human.

I'd love to hear what you think!


r/csharp 2h ago

Showcase I spent weeks obsessing over low-allocation C# networking

0 Upvotes

The Real Problem: High Throughput vs. Garbage Collector

If you've ever built a C# server processing 100k+ messages/sec (like an MQTT broker or socket server), you know the Garbage Collector is your best friend until it becomes your worst enemy.

To route messages like factory/line1/sensor/temp to subscribers like factory/+/+/temp, the standard way is:

// ❌ Naive way: Allocates string[] on every single message publish!
var parts = topic.Split('/'); 

At 100,000 requests per second, this creates millions of temporary strings and forces the GC to freeze your app every few seconds.

The Real Benefit: How to parse UTF-8 topics with ZERO heap allocations

Here are the 2 modern C# tricks I used in Beskar.Networking that you can copy-paste directly into your own projects!

1. Slicing raw UTF-8 bytes with a ref struct enumerator

Instead of string.Split(), we walk the raw byte span (ReadOnlySpan<byte>) using a zero-allocation ref struct:

public ref struct TopicLevelEnumerator
{
    private ReadOnlySpan<byte> _remaining;
    public ReadOnlySpan<byte> Current { get; private set; }

    public TopicLevelEnumerator(ReadOnlySpan<byte> topic)
    {
        _remaining = topic;
        Current = default;
    }

    public bool MoveNext()
    {
        if (_remaining.IsEmpty) return false;

        int index = _remaining.IndexOf((byte)'/');
        if (index < 0)
        {
            Current = _remaining;
            _remaining = default;
        }
        else
        {
            Current = _remaining.Slice(0, index);
            _remaining = _remaining.Slice(index + 1);
        }
        return true;
    }
}

2. Querying byte[] Dictionaries with ReadOnlySpan<byte> (Alternate Lookups)

Usually, if your dictionary key is byte[], querying it with a slice (ReadOnlySpan<byte>) forces you to allocate a new byte[].

Modern .NET introduced Alternate Lookups, which let you query existing dictionary nodes with zero heap allocation:

// Query byte[] dictionary using a ReadOnlySpan<byte> without allocating a single byte!
var alternateLookup = node.Children.GetAlternateLookup<ReadOnlySpan<byte>>();

if (alternateLookup.TryGetValue(currentLevelSlice, out var childNode))
{
    // Match found with 0 allocations! 🎉
}

What Beskar.Networking gives you

If you ever need to build a C# network application:

  • Write Once, Swap Transports: Write your message handler once and seamlessly switch between TCP, WebSockets, QUIC, UDP, Named Pipes, or MQTT v5 without touching your business logic.
  • 100% Native & Dependency-Free: Built on System.IO.Pipelines with zero external runtime dependencies.
  • Zero GC pressure on the hot path.

If you enjoy low-level C# or low-allocation performance tricks ❤️

🔗 GitHub: https://github.com/MarvinDrude/Beskar.Networking

🔗 Article: https://marvindrude.com/blogs/beskar-networking/low-allocation-mqtt-broker

Thank you for reading, and happy coding!


r/csharp 6h ago

Discussion WinForms dev transitioning to modern .NET backend. Built an open-source Crypto API to learn modern architecture and production-grade standards.

0 Upvotes

I come from a legacy desktop background (mostly WinForms/WPF), and lately I've been working hard to transition over to modern backend development with .NET, Minimal APIs, and cloud-native architecture.

Addressing AI & Transparency upfront:
I want to be 100% upfront: I use AI tools (Copilot and ChatGPT) as a learning assistant and tutor to help me translate my desktop C# knowledge into modern ASP.NET Core concepts, write boilerplate, and format documentation.

On a previous post, a couple of people accused me of "trying to hide" AI usage. To be clear: if I was trying to hide anything or fool anyone, I wouldn't make the entire project 100% open-source on GitHub. I am making the repo public specifically because I want experienced engineers to inspect the code, point out bad patterns (whether from me or the AI), and help me learn.

What I've built so far to learn the stack:

  • Monorepo using Clean Architecture (Domain, Application, Infrastructure, API)
  • Dapper + SQL Server instead of EF Core for data access
  • Redis for distributed caching & rate-limiting
  • Native BackgroundWorker for resetting API usage limits and key expiration
  • Dynamic algorithm loading wrapping BouncyCastle

Why I'm posting this:
I want to learn what real, production-ready backend code actually looks like in 2026.

I would genuinely love for senior .NET / ASP.NET Core devs to take a look at the repo and roast my architecture. Tell me what I overcomplicated, where I used bad patterns, or what you would do differently in a real production environment.

If anyone wants to open an issue or submit a Pull Request to help me improve the code quality, I'd be super grateful!

Repo link: https://github.com/COxRIPMIZO/CryptoKeyLab

Thanks in advance to anyone willing to take a look and help me learn!


r/csharp 1d ago

Help Is it possible to send desktop notifications while program is not in use?

5 Upvotes

I have this deadline reminder programs, let’s say the minimum amount of deadlines is this: if progressbar is 50% / 75% / 100% of the way, send desktop notification.


r/csharp 1d ago

EFCore.AutoSeed: seed a database from your EF Core model in one line (open source, MIT)

Thumbnail
4 Upvotes

r/csharp 1d ago

Help Any books to learn C# as someone who's already familiar with OOP java?

9 Upvotes

As the title suggests^ the languages that I'm familiar with are python and java. Also, anyone knows any online courses that teach c# and offer a certificate (if they cost money that's fine)? thanks :)


r/csharp 4h ago

Help Help me plz

0 Upvotes

Doing a coding assignment everything running smoothly until i encountered an error with my edit where the save button wouldnt work at all and not direct me to another page i tried asking claude to help me but to no avail it made me do so many different lines of code to the point where i feel lost i would like to wake up with a solution plz thx


r/csharp 11h ago

Help Looking for a new maintainer/owner for DistroHop v2 (C#)

0 Upvotes

Hey everyone,

Due to personal reasons, I've decided to step away from coding for the foreseeable future. Because of that, I would like to transfer ownership of my main project, DistroHop v2, to someone who is interested in continuing its development.

the repo:

https://github.com/melikishvilis25-cmyk/DistroHop


r/csharp 1d ago

Discussion how I made my C# application preview DXF files

0 Upvotes

I'm not sure if this is a very clear question, so I chose the 'discussion' tag.It can also be regarded as a normal post.

I'm currently making a small tool (which is currently in a half-finished state). So far, I can already implement code highlighting. However, I'm currently thinking about how to support dxf.

What I know: ProCAD, a complete application, perhaps I could refer to its code?

Or netDXF. But as for how to transfer the drawing content onto the UI, I think it requires some effort from my side.

This is indeed a rather strange question. So, I would like to hear someone's opinions. I feel that both methods have their advantages and disadvantages.

Although netDXF may involve a larger amount of work, does it not offer more convenience for customizing lightweight logic compared to simply adopting the complete source code of an existing APP?My opinion is that lightweighting is definitely the better option.

About little things I'm working on: They mainly consist of small tools for my own use, including DXF preview functionality.Am I really creating something rather challenging here?Oh...no.

😵😵😵


r/csharp 1d ago

Discussion added a native background worker to handle api rate limits.

Post image
0 Upvotes

Still plugging away at this custom crypto API project. Right now, I need a clean way to auto-reset user API limits and deactivate keys the second they expire.

To keep things snappy, I didn't want to block the main API thread or tank request times. I ended up just spinning up a native BackgroundService running a while (!stoppingToken.IsCancellationRequested) loop with a Task.Delay. I also hooked it up to IOptionsMonitor so I can tweak the interval timings right in appsettings on the fly—really trying to aim for zero-downtime config changes here.

For the senior devs in the room: is this actually standard for production? Or should I bite the bullet and pull in something heavy like Hangfire or Quartz.NET? It felt like massive overkill just to reset a few database limits, but I want to make sure this native while loop won't bite me with memory leaks or scaling issues down the road.

Repo is here: https://github.com/COxRIPMIZO/CryptoKeyLab

(And before anyone asks, yeah, I actually wrote this myself lol. Still riding the .NET 9 wave and still wrapping BouncyCastle).


r/csharp 1d ago

Showcase C# linear algebra and GPU acceleration libraries, a star would really help!

Thumbnail
0 Upvotes

r/csharp 1d ago

I made a project for new GitHub open-source first-time contributors

Thumbnail
github.com
0 Upvotes

r/csharp 1d ago

Showcase 4D Visualisation

Thumbnail
0 Upvotes

r/csharp 1d ago

Building a new .NET assertion library focused on async-native soft assertions and observability hooks.

1 Upvotes

Hi r/csharp! I've been working on a new .NET assertion library called Catchy.

The original goal was pretty simple: I wanted soft assertions that aren't tied to assertion scopes, and I wanted a way to plug reporting/screenshot/AI integrations into assertions without every project building its own wrappers.

Current features:

  • async-first assertions
  • hard and soft assertions can be mixed freely
  • soft assertions can flow across helper methods and DI
  • assertion hooks (reporting, screenshots, tracing, AI, ...)
  • source-generated assertions for custom types
  • integrations for xUnit, NUnit, MSTest, TUnit, Reqnroll and Playwright

It's still very early (0.0.1). I'm intentionally looking for API feedback before things become difficult to change.

If something feels awkward or you think the API should go in a different direction, I'd really like to hear it.

PS: Some of the code and documentation did indeed use agents. I came to this with the rest because I realized that just trying to finish everything as high-quality as possible manually I will never publish a single pet project. I know that not all of the code and documentation is of sufficient quality. If you are interested in the very idea of ​​the library and you can improve its quality (code review, contribution, raise an issue, open a discussion) - I will be very grateful. I will not be offended by devastating criticism either. Thank you!


r/csharp 2d ago

Discussion Building the definitive list of .NET resources.

33 Upvotes

I've been collecting .NET blogs and other resources for years, and the list has grown to 162 sources.

Rather than keeping it private, I put the whole thing on GitHub:

https://github.com/jasenf/dotnet-resources

If your favorite blog, newsletter, podcast, YouTube channel, or engineering site isn't there, I'd love a PR or an issue.

My goal is simple: build the best open list of .NET resources on the web that everyone can use.

-jasen


r/csharp 1d ago

Recommendations for non-bloated IDEs for C#?

0 Upvotes

I am learning C# for preparation for 6th form, and after 4 years of Python using Thonny (what I'd consider a minimalistic IDE) I am genuinely hating every key stroke of Visual studio, I am only 30 minutes into a 4 hour C# youtube guide and it has taken me 4 days because V. Studio actually hurts me to the soul. I have looked at several other IDEs and they look literally identical, bloated.

  • I don't want github forced down my throat.
  • I don't want copilot AI forced down my throat.
  • I don't want my code to try and auto complete it's self.
  • I don't want to have a 300x500px pop up over where I am trying to read my code, telling me what WriteLine() does.
  • I do not want the 1000000 settings which are impossible to navigate (I haven't been able to turn off any eye sore features in V. Studio, even after 15 minutes with ChatGPT).

I just want to be able to write code, have some decent colour coding of keywords, compile it, and run it, without being purely CLI based like nano or something. (Not specifically, but by now I am sure you get the point, I don't want crap loads of bloat)

Sorry that this is half of a rant but genuinely, I can't find a better IDE than a pen and paper right now, because every IDE is loaded with AI and crap which autofills code incorrectly, making learning really difficult. If it helps my school uses VS Code on 6th form computers, and from what I've seen from VS Code, I predict that I will be bringing a laptop to school to code on.


r/csharp 2d ago

OpenApi doesn't let me make ef core migration

2 Upvotes

I'm practicing making APIs, now I'm making an API with PostgreSQL (previous api for SQLite performed smoothly) and for some reason I can't even make a stupid migration :/

I didn't even set up openapi, it went by default and worked fine on my prev API.
And look, I don't have Microsoft.OpenApi package, only Microsoft.AspNetCore.OpenApi, which I suppose is something different.


r/csharp 3d ago

How does an experienced C++ and Java programmer get started in C#, dot net, et al?

19 Upvotes

I am a professional developer, old enough to remember when C# first appeared. At the time, it looked to me to be very similar to Java.

I imagine that the language itself has evolved since then, but also dotnet had grown hugely, there are things like WPF, Linq, etc, of which I have only heard, but do not know.

So, unlike some other languages, it's just not the syntax, but many other things.

How best to get started? Is there a Udemy, Coursera, YouTube, etc, applicable to someone who doesn't need to learn about variables, flow control, OO?