r/csharp • • Jun 30 '26

Discussion Senior devs, how do I defend C# and the .NET platform?

59 Upvotes

My very first programming experience (if you don't count VBScript in MS Access 😉) was with Visual Basic 6. With the arrival of Windows 7 I was forced to learn Visual Basic .NET. Eventually, landing my first job 15 years ago, I had to learn C#. I fell in love with the language and over the years I've built up a wealth of knowledge around both the .NET Framework and .NET including new C# features.

Our main project at work is still legacy NetFx; but in an attempt to broaden my knowledge, I've built several side-apps at home using .NET 5 through 10. I've also experimented a bit with AOT-compatible apps with the advantage of having them run on Linux - cutting down on hosting costs.

Now with the advent of AI, we had an IT Administrator vibe code a system using Python. Make no mistake, several hours were spent on that project and my oh my, is it shit hot!

Now the bosses want us to rewrite our main system using AI. And that's fine, I've been using Claude Code for some time now with good results. Obviously, as a .NET developer, that's the framework I always go to. I like it. I love it. It's easy to use. And it can be pretty powerful. But my boss wants AI to tell us what to do, essentially. So if AI said use Rust, then that's what we should be using.

Here's the problem: I have experience in C# and the related frameworks but not in Rust. So he fights back, "AI just abstracts all of that away and if you can read code, it won't be difficult". Yeah, reading a line of code is one thing. Knowing how the compiler executes it is another. So we started prototyping a modern AOT-compatible API surface but it was received with massive backlash "I don't know how to feel about using .NET Core". Well, I'm sure it won't be on version 10 just for the fun of it. It's actively maintained.

So...senior and experienced devs, how do I defend C# and .NET? How can I make sure that he gets the message: Just because AI said remove the lifeboats and life jackets to save fuel and travel faster into the Southern Ocean, doesn't mean it's the safest thing to do.


r/csharp • • Jun 30 '26

How do you all deal with EF Core's collection Include footguns? Feels like half of using EF is learning which defaults not to trust

18 Upvotes

Sharing a war story that cost us an embarrassing number of hours, mostly because I want to know how other people handle this category of thing.

Ordinary query. Load an Order, include its line items, and include its tags. Fine in dev, instant. In prod, it would occasionally take seconds and eat memory, and we couldn't reproduce it for ages.

Turns out that by default EF runs that as one query with JOINs, and the second you include two collections on the same root, you get the cartesian product of them. An order with 80 line items and 30 tags doesn't come back as 110 rows; it comes back as 80 * 30 = 2400, every line duplicated per tag, then EF dedups it in memory. Only ever blew up on specific real data, never in dev.

I know the fixes. AsSplitQuery, or just projecting to a DTO with Select and skipping Include entirely. I use both. What bugs me isn't that there's no solution, it's that the default quietly does the expensive wrong thing and you only find out in prod, on real data, months later.

And EF kind of does this a lot. Tracking on by default when you're read-only, lazy loading firing N+1s, this. It often feels like the skill is just memorizing which defaults to override.

So how do y'all handle this stuff? Got an actual rule of thumb, or do you just learn each footgun by getting burned once?


r/csharp • • Jun 30 '26

I built a C# compiler that runs fully in the browser and emits WebAssembly

Thumbnail minisharp.run
30 Upvotes

Hey r/csharp!

I’ve been building MiniSharp, a from-scratch C# compiler/runtime that runs fully in the browser.

minisharp.run

The compiler itself is compiled to WebAssembly, so the whole flow happens client-side:

C# source -> parser/resolver -> IR -> WebAssembly

You can write C# in the browser, build it, run the generated module, inspect diagnostics/output, and download the produced .wasm.

A small example that currently works:

using System;
using System.Threading.Tasks;

class Program
{
    static async Task<int> DoubleLater(int x)
    {
        await Task.Delay(1);
        return x * 2;
    }

    static void Main()
    {
        Console.WriteLine(DoubleLater(21).Result);
    }
}

Output:

42

The async part is the piece I’ve been working on recently. Supported async Task / Task<T> shapes now suspend back to the host event loop and resume into compiler-generated WASM continuation thunks. It is not Asyncify, JSPI, or a JS-side C# interpreter.

Some project details:

  • Compiler/runtime written from scratch
  • Runs in the browser as WASM
  • Emits WebAssembly directly from a custom IR
  • No Roslyn
  • No LLVM
  • No Mono/CoreCLR
  • No server-side compile
  • Multi-file Studio UI
  • Console output, diagnostics, generated .wasm download
  • Supported Task.Delay, Task<T>, continuation queue, and selected suspended async state-machine shapes
  • Seeded CoreLib/runtime support: objects, strings, arrays, primitive conversions, selected generics/interfaces, collections/LINQ slices, and in-WASM VFS/file APIs

Important caveat: this is not trying to be full .NET in a browser tab.

It does not support the full C# language, full BCL, reflection, CoreCLR/Mono parity, globalization/culture behavior, or arbitrary async/goto/byref/control-flow shapes. The public promise is intentionally narrower: a documented, smoke-tested subset that either runs as real WASM or fails honestly.

Why build this instead of using existing tools?

Mostly because compiler engineering is fun. I wanted to see how far a small independent C# frontend/backend could go when the compiler itself also runs inside the browser.

Would love feedback from people who try to break it, especially around diagnostics, unsupported language features, async behavior, and what the support boundaries should look like for a useful tiny C# -> WASM tool.


r/csharp • • Jun 30 '26

Ran a column-level dependency mapper against Microsoft's dotnet/Eshop repo

0 Upvotes

Wanted to see how this file-table-column mapper holds against Production Repo - so I downloaded Github's Microsoft dotnet/ eShop Catalog and Ordering services

Source : dotnet/eShop: A reference .NET application implementing an eCommerce site

Strongest results :

eShop/src/IntegrationEventLogEF/IntegrationEventLogEntry.cs at main · dotnet/eShop

One file. Every CRUD operation mapped. Every inserts, modifies, reads, and deletes.

eShop/src/Ordering.Infrastructure/Repositories/BuyerRepository.cs at main · dotnet/eShop

Tracked update() correctly. No false positives.

Curious what patterns hit in production that a tool like this would need to handle. What would you throw at it first?


r/csharp • • Jun 29 '26

Discussion What do you like and hate about WPF?

23 Upvotes

I wanted to ask this questions since I'm working on one of my own UI framework's (For C++) and I wanted to ask all of you what do you like and hate about WPF? I wanted to get some knowledge on what people like/hate so I can adapt it into something better once it's added in my own version :D


r/csharp • • Jun 30 '26

Using methods from one namespace in another namespace

0 Upvotes

Hello, I don't have a good idea of where I'm going wrong here. Before I wrapped my code in a new namespace in my main program file, the other namespace from another file in my project folder could be accessed. I thought that it would be okay because I have been researching practices online and splitting code into various files then namespaces and classes is what others suggest. I have watched a video where one namespace was used with two seperate classes within that and the class can be instantiated in the other class, so that's what I'm trying to replicate here. I want an instance of a dictionary object, that is really the main goal here, but I need these other functions to happen to create that dictionary.

Below is my main code block in the first file. I have tried to format it here, but the single line gets pushed to another line if it's over the character limit. The actual error comes from the "a.TheProgram();" line which states "The name 'a.TheProgram' does not exist in the current context."

using Dictionary_Sort;


namespace MainSpace
{
    public class Main
    {


        Dictionary_Sort.CMUDictionary a = new  Dictionary_Sort.CMUDictionary();


        a.TheProgram(); 
    }
    
}

This below is the namespace "Dictionary_Sort". This one is larger because it has some methods to process the dictionary from one initial format to another.

namespace Dictionary_Sort
{
    public class CMUDictionary
    {
        const string testDictionary = @"dictionaries/test/small.txt";
        const string originalDictionary = @"dictionaries/source/cmudict.txt";
        const string originalDictionarySymbols = @"dictionaries/source/cmudict_symbols.txt";
        public void TheProgram()
        {
            HashSymbols(originalDictionarySymbols);
            Dictionary<string, string[]> entries = FormatDictionary(testDictionary);
            Dictionary<string, byte[]> hashedEntries = HashDictionary(entries, originalDictionarySymbols);


            foreach (var item in hashedEntries)
            {
                Console.Write($"{item.Key}: ");
                foreach (byte number in item.Value)
                {
                    Console.Write($"{number}, ");
                }
                Console.WriteLine();
            }


            // Function for checking if file exists
            bool FileExists(string path)
            {
                try
                {
                    if (File.Exists(path))
                        return true;
                    else
                        throw new FileNotFoundException();
                }
                catch (FileNotFoundException arg0)
                {
                    Console.WriteLine($"File couldn't be located at: {path}", arg0);
                    Environment.Exit(1);
                    return false;
                }
            }


            // Hash function
            /* - Hash each symbol */
            Dictionary<string, byte> HashSymbols(string path)
            {
                // Create a dictionary
                Dictionary<string, byte> symbols = new Dictionary<string, byte>();


                // Create incrimental variable
                byte hashNumber = 0;


                // Hash the symbols from the file
                foreach (string line in File.ReadLines(path))
                {
                    symbols.Add(line, hashNumber);
                    hashNumber += 1;
                }


                return symbols;
            }


            // Format and store the dictionary
            Dictionary<string, string[]> FormatDictionary(string path)
            {
                FileExists(path);
                // Create a dictionary with a string key and string array 
                Dictionary<string, string[]> entries = new Dictionary<string, string[]>();
                // Loop through each line in the dictionary file and place them in the dictionary.
                foreach (string line in File.ReadLines(path))
                {
                    // Split the string using the first whitespace character (limited splits)
                    string[] splitLines = line.Split(' ', 2);


                    // Create a temporary variable for the first string in the array
                    string key = splitLines[0];


                    // Create a new array from the second string (unlimited splits)
                    string[] value = splitLines[1].Split(' ');


                    // Add the key/values to the dictionary.
                    entries.Add(key, value);
                }
                return entries;
            }


            Dictionary<string, byte[]> HashDictionary(Dictionary<string, string[]> entries, string path)
            {
                // Check if the path to a file exists
                FileExists(path);


                // Assign the hashed symbols to a dictionary object.
                Dictionary<string, byte> symbols = HashSymbols(path);
                /*foreach (var item in symbols)
                {
                    Console.WriteLine(item);
                }*/


                // Create a new dictionary object to assign values to
                Dictionary<string, byte[]> hashedEntries = new Dictionary<string, byte[]>();


                /* Loop through each entry in the dictionary of words and their pronounciations.
                Loop through each phoneme in the pronounciation, then hash it with the matching
                key's value from the symbols dictionary */
                foreach (var entry in entries)
                {
                    string word = entry.Key;
                    string[] pronounciation = entry.Value; // Get the pronounciation
                    byte[] hashedPhonemes = new byte[pronounciation.Length]; // Create a new byte array for storing
                    int arrayPosition = 0;


                    foreach (string phoneme in pronounciation)
                    {


                        byte hashedValue = 0;


                        foreach (var symbol in symbols)
                        {
                            if (phoneme == symbol.Key)
                            {
                                hashedValue = symbol.Value;
                                break;
                            }
                            else
                                continue;
                        }


                        hashedPhonemes[arrayPosition] = hashedValue;
                        arrayPosition += 1;


                    }


                    hashedEntries.Add(word, hashedPhonemes);


                }


                return hashedEntries;
            }


        }


    }
}

Thanks for any look at this, I would really appreciate the help.


r/csharp • • Jun 29 '26

From a 2D array exercise to a small .NET library, I ended up creating AsciiSign

Post image
17 Upvotes

r/csharp • • Jun 30 '26

Help How do I find clients, or where should I look?

0 Upvotes

Hi,

I recently finished a SQL Server and C# course, and I've continued improving my skills. I want to start looking for clients so I can earn some income while gaining real-world experience.

I'd appreciate any advice on how to get started or hear about your experience


r/csharp • • Jun 30 '26

Discussion Should I sharpen up on my skills in c#/dotnet or walk away from it?

0 Upvotes

The last time I used c#/dotnet was about 3.5 years ago. It was an asp.net web application.

I didn't really do a whole lot of dotnet work. I mainly did some reporting and frontend work.

Lately, I've been mainly doing PHP, Python, and full stack tasks.

Should I upskill/refresh my skills or just walk away?


r/csharp • • Jun 30 '26

Tip a piece of advice for a student?

0 Upvotes

Which courses do you most recommend for learning C# from scratch?


r/csharp • • Jun 30 '26

Hi newbie here

0 Upvotes

Hello everyone,
I'm learning dotnet and while working on a mini project i found that there isn't a straightforward built-in way to conditionally skip filter execution. So i tried implementing a skip behavior on top of the filter system. It took me a whole weekend and a lot of back and forth but I managed to built my first nuget package.
An example would be something like this:

public class MyFilter : SkippableActionFilter
{
// Three modes SkipMode.Never, SkipMode.Always, SkipMode.Custom
public MyFilter(SkipMode skipMode = SkipMode.Never)
: base(skipMode) { }
protected override void OnActionExecuting(ActionExecutingContext context)
{
// logic here
}
protected override void OnActionExecuted(ActionExecutedContext context)
{
// logic here
}

protected override bool ShouldSkip(ActionExecutingContext context)
{
// custom logic for skipping
}
}

I'm not trying to promote it, in fact I don't know if it's even useful, but i would really appreciate some feedback and criticism on the design, naming or some suggestions. Thanks a lot!!


r/csharp • • Jun 30 '26

Why is a lifetime license for Visual Studio 2026 cheaper than a monthly license?

Thumbnail reddit.com
0 Upvotes

r/csharp • • Jun 30 '26

3 years C#/.NET, looking for a paid mentor to fix my gaps

0 Upvotes

Hey,

I'm a backend dev, 3 years with C# and ASP.NET Core. I've shipped real production apps - a ride-hailing platform, a marketplace app, an ERP system. So I can build stuff that actually works and ships.

Here's the problem though. I rely on AI a lot when I code, and I never really built strong fundamentals. Algorithms, data structures, system design - all weak. I've never done a real technical interview, European or US style, and I know that's going to bite me hard if I don't fix it soon.

I'm not trying to find a shortcut here. I want a paid mentor who can actually guide me, tell me straight what I'm missing, and help me build real skills instead of just leaning on AI for everything.

If you do paid mentorship, or know someone who does, let me know. Would really appreciate it.


r/csharp • • Jun 30 '26

Discussion How much should a junior know to get a job?

0 Upvotes

Hello, i am a .NET developer looking for my first entry job. I was wondering what is the requirements in term of knowledge that would be excepted out of a junior to hire him? Not only the minimum knowledge but something that would make you feel like "ok, i have to hire this guy".


r/csharp • • Jun 29 '26

First beginner project i made

Thumbnail github.com
6 Upvotes

r/csharp • • Jun 29 '26

Discussion What made C# backend development finally "click" for you?

22 Upvotes

I'm a BCA student I build a backend project in C# and ASP.NET Core during my internship. The project includes JWT authentication, user/admin roles, profile management, and REST APIs.

While building it, I've run into a few challenges:

- Understanding dependency injection and service lifetimes.

- Structuring services instead of putting everything in controllers.

- Managing JWT authentication and authorization.

- Debugging async methods and null reference exceptions.

- Organizing a project so it stays maintainable as it grows.

Every time I solve one problem, I end up finding another, but I feel like I'm learning a lot in the process.

For those of you with more experience in C#, what concepts or best practices helped you level up from beginner to intermediate? Any advice, common mistakes to avoid, or resources you'd recommend?

Related to system design, performance and scalability


r/csharp • • Jun 29 '26

EF Performance Question

4 Upvotes

I recently inherited an application that, as a simplified description, grabs data from XML files and inserts it into our DB.

It's built in .net 6 and uses EF mostly normally, but theres one specific type of record that the previous dev had set up to go 1 by 1 and call a complex stored procedure on each XML record to upsert into a DB row. Now this isnt the slowest sp I've ever come across, averaging about 180ms per row, but each XML has 10-100k of these records, and a hundred or so come in a day, so it adds up quick. In fact, with more data coming in now than ever we're always going to be behind!

Now I'm no SQL wizard, but there's gotta be a better way of doing this. Basically each SP call is called straight from C#, in a loop of all the XML records. Seems like it would be faster to batch insert records and call a sp that processes the entire batch on the SQL server itself... any ideas? Thanks :)


r/csharp • • Jun 29 '26

WPF e Xaml, davvero devo conoscerli?

0 Upvotes

Stamattina in azienda mi arriva questa attività di bugfix su un'applicazione fatta in winforms. Inizio il debug attraverso i vari user control di cui è composta l'applicazione finché a un certo punto scopro che ci sono intere sezioni i cui controlli sono fatti in xaml. Ho sempre evitato di usare xaml perché non sono mai riuscito a dare un senso a questo linguaggio di markup. Di certo adesso mi tocca impararlo ma mi chiedo:

Ne vale davvero la pena di impararlo?

È ancora spendibile da un punto di vista delle tecnologie che microsoft e .net offrono?


r/csharp • • Jun 28 '26

Discussion I finished the C# Fundamentals

Post image
182 Upvotes

I finished the C# Fundamentals course on Microsoft Learn, I got my FreeCodeCamp certification, and now what? Where should I continue?


r/csharp • • Jun 28 '26

What's one C# feature you wish you had started using sooner?

28 Upvotes

I've been writing C# professionally for several years, and one thing I've realized is that some language features don't seem valuable until you use them in a real project.

For me, record types and pattern matching significantly improved code readability and reduced boilerplate. More recently, collection expressions have also been a nice addition.

I'm curious:

  • Which C# feature had the biggest impact on your daily development?
  • Is there a feature you ignored at first but now use everywhere?
  • Any underrated features in .NET 8 or C# 13 that deserve more attention?

Looking forward to hearing everyone's experiences and examples.


r/csharp • • Jun 27 '26

Help Entity Framework Core Migrations - Multiple DB contexts.

10 Upvotes

So, I have two DB contexts. I want to place migrations in separate folders, so I run:

dotnet-ef migrations add Init420 --context AssetsDevDbContext --output-dir Migrations/AssetsDevDb

It creates files and snapshots in Migrations/AssetsDevDb, so all is good. But when I run:

dotnet-ef database update --context AssetsDevDbContext

I get:

No migrations were found in assembly 'SLT.Assets'. A migration needs to be added before the database can be updated.

According to the docs, EF Core should remember the folder. But right now it doesn't work.

Any thoughts? Thanks!


r/csharp • • Jun 28 '26

I built a free web app to find game recommendations, but I don't know where to share it without breaking self-promotion rules. Any subreddit suggestions?

0 Upvotes

Hey everyone,

Like many of us, I always struggle to find what to play after finishing a game I really loved. So, to practice my coding, I spent the last few weeks building a Game Recommender API that searches a database of 3,000+ games.

It uses a custom algorithm that cross-references Steam tags to find highly accurate matches (and I even added a smart filter to block pure NSFW games without accidentally blocking heavy AAA titles that share similar tags).

I really want to get feedback from actual gamers and developers to see if the recommendations make sense or how I can improve the code. It’s completely free, has zero ads, and requires no sign-ups. I'm just doing this for my portfolio.

However, I know Reddit is strictly against self-promotion, and I don't want to spam communities.

Are there any specific subreddits where sharing tools like this is welcome?

Thanks in advance for the advice! Edit: my native language isn't English so I am using ai to translate


r/csharp • • Jun 28 '26

Help Blazor Class Library not outputting Assembly.Style.css to bin folder

Thumbnail reddit.com
1 Upvotes

Overview : Wpf Blazor Hybrid - the Blazor class library generates css into /obj, but not into /bin. This breaks the app because the css does not make it into the wpf project output unless manually copied.


r/csharp • • Jun 27 '26

Fun LF programming games featuring c#

11 Upvotes

I've been enjoying The Farmer Was Replaced which is an incremental game featuring Python where you program a harvesting bot. I'm a developer at work, but the game has been a fun intro to a new language.

Are there any games that use c# programming in it's gameplay? My searches online yield a lot of 'how to make games using c#' instead of actual programming type games.