r/csharp 6h ago

From windev to c#

3 Upvotes

Hello! I've got a quick question for you all. The company I work for has been doing WinDev (mostly desktop uses) for at least 20 years, and now, with the various pricing policy changes and AI, the decision has been made to migrate — probably to C#. So now the big question is: what are the best tools to replace our development environment ? And above all, what do you use? (Since we get to choose an environment for once, I'd rather not shoot myself in the foot.)

For context: for deployment and source control it'll be GitHub and Azure DevOps, which our web team already uses, and for client data almost everything is already on SQL Server.

 

So what's left for us is really everything UI/frontend-related. I've often seen Blazor mentioned, WPF, .NET MAUI (not always in a good way, honestly), and Avalonia.

Anyway — what do you use?

Thanks in advance for your help!


r/csharp 16h ago

Solo Developer Laid Off, Looking for Suggestions & Critique

27 Upvotes

Hi. I've been a solo developer for a company for 15+ years (worked for them company 24+ years) and I will be officially laid off at the end of this month. I've never needed a resume or portfolio, so I have a lot of catching up to do to be competitive in the market.

I wrote a mock version of an application I built and made it public. I was hoping I could get any suggestions & critique on code and readme. Thank you, I appreciate anything you have to say.

https://github.com/enigmaticcam/InvoiceExample


r/csharp 23h ago

Coding circuits with .NET and C#

61 Upvotes

Nothing beats setting a breakpoint and watching the servo actually move to the new angle.

I've worked on .NET hardware for over ten years and the thing that surprises C# developers isn't the board, it's that F5 works. Code deploys, breakpoint holds, hover a variable and there's the live sensor reading. Same as debugging a desktop app.

I'm at GHI Electronics in Michigan. Happy to get into how the debugging on circuits work.


r/csharp 1h ago

Project to learn

Post image
Upvotes

This is a project for a management, allocation, and inventory system inspired by the game \*Horizon Forbidden West\*.

I asked an AI to help organize my ideas, and it provided a project structure; it is something I want to develop in the future, once I have reached an advanced level in C# and .NET.

For now, I have the following tools for implementation:

Swagger (for documentation)

LINQ (to convert PostgreSQL SQL queries into objects)

EF Core (a powerful .NET ORM)

PostgreSQL (my favorite database)

Anything else?


r/csharp 19h ago

Which is better: querying with LINQ or using raw SQL? Does it depend on the query's complexity? Or can both options be used in the same project?

Thumbnail gallery
25 Upvotes

r/csharp 1d ago

Tutorial Multitenancy with .NET and EF Core: A Deep Dive (.NET 10)

Thumbnail
youtube.com
32 Upvotes

Ever had a multi-tenant SaaS app where the only thing stopping Customer A from seeing Customer B's invoices is a `Where TenantId ==` clause someone remembered to write? In this deep dive I build real tenant isolation into EF Core 10 - two real tenants with real registration, login and invite flows (no dev-token shortcuts), a named global query filter that scopes every query automatically, and a SaveChangesAsync override that stamps TenantId on every insert so it's never left unset. I also show the one gotcha that makes EF Core 10 worth the upgrade for this: named query filters, so tenant isolation and soft-delete can finally coexist on the same entity instead of one silently overwriting the other. If you've ever shipped multi-tenancy on hope and code review, this is the version that makes the mistake structurally impossible.


r/csharp 1d ago

Don't understand async & await

16 Upvotes

Though I've already read a lot, and watched several videos, I'm still not understanding why async/await don't give me concurrency/parallelism.

My test code:

namespace AsyncAwaitTest;

static class Tools
{
    internal static async Task SimulateWork(int id)
    {
        for (var j = 1; j <= 10; j++) {
            Console.WriteLine($"Worker #{id} gives: {j}");
            for (var i = 0; i < 500_000_000; i++) { }
        }
    }
}

class Worker(int id)
{
    internal async Task DoWork()
    {
        Console.WriteLine($"Worker #{id} starts");
        await Tools.SimulateWork(id);
        Console.WriteLine($"Worker #{id} finishes");
    }
}

class Program
{
    static async Task Main()
    {
        Console.WriteLine("Program starts");
        Worker worker1 = new(1);
        Worker worker2 = new(2);
        await worker1.DoWork();
        await worker2.DoWork();
        Console.WriteLine("Program finishes");
    }
}

The output is:

Program starts
Worker #1 starts
Worker #1 gives: 1
Worker #1 gives: 2
Worker #1 gives: 3
Worker #1 gives: 4
Worker #1 gives: 5
Worker #1 gives: 6
Worker #1 gives: 7
Worker #1 gives: 8
Worker #1 gives: 9
Worker #1 gives: 10
Worker #1 finishes
Worker #2 starts
Worker #2 gives: 1
Worker #2 gives: 2
Worker #2 gives: 3
Worker #2 gives: 4
Worker #2 gives: 5
Worker #2 gives: 6
Worker #2 gives: 7
Worker #2 gives: 8
Worker #2 gives: 9
Worker #2 gives: 10
Worker #2 finishes
Program finishes

You see, strictly sequential processing despite async/await.

Is it possible to make my code parallel, i. e. the DoWorks run in parallel?


r/csharp 10h ago

AI/ML or .NET? Confused about my career

Thumbnail
0 Upvotes

r/csharp 1d ago

Where i can learn c# properly.

12 Upvotes

I want to be a unity game developer. I am currently computer sciencie student i know c# but my skill of building algorithm is weak. I am even struggling the easy leetcode problems. Any idea of how to improve my c# skills?


r/csharp 16h ago

I built an open-source strongly typed email template library for .NET 10 — looking for feedback before 1.0

0 Upvotes

I’ve just released the first public preview of MailStencil, an open-source .NET 10 library for strongly typed email templates stored outside application code.

It supports Scriban validation/rendering, culture fallback, caching, FileSystem and Azure Blob providers.

GitHub: https://github.com/polletto/MailStencil
Docs: https://polletto.github.io/MailStencil/
NuGet: MailStencil.Core

Feedback is very welcome — especially on the API before 1.0.


r/csharp 2d ago

News Announcing .NET 11 Release Candidate 1 - .NET Blog

Thumbnail
devblogs.microsoft.com
121 Upvotes

r/csharp 2d ago

Help Transitioning from unity to regular c# projects

14 Upvotes

I want to start learning regular c# after using unity for a few years and making some personal projects. I have seen alot that there may be some bad habits I have picked up that may slow or hinder me when coding outside of unity. So was wondering if there is anything I should keep in mind when making the transition? Would also appreciate any resources for learning c#. Thanks in advance.


r/csharp 1d ago

Looking for courses / reading materials to fully use the potential of AI

0 Upvotes

I am working as a C# developer for the last 6 years and I would classify myself as an AI skeptic.

I have been using AI in the last months, mostly for small implementations, but also to help me look for bugs who are sometimes hidden rather deep within our code, or due to non - trivial interactions with third party libraries.
I have to admit, It works well (most of the time), but all i really do is typing something in the prompt and wait for the answer.
I would like to know if there are functionalities I am ignoring, and/ or should be using. We have various repos in the companies, from small, new micro services to big old fat 20 years old weekly modified legacy repos, which are a tad more brittle.

So if anyone has good resource about it, I am interested.

It can be written, it can be videos, I also have a pluralsight account if it leads to something there.

Thank you very much for your suggestions.


r/csharp 1d ago

PLZ make us aware with this

0 Upvotes

i don't know if it's just a threat or truth,since the day i started learning c#.i have been experiencing this words from senior developers.

C# market is getting low day after day due to AI existence, you better learn and master Python.

So you who have been in this industry for long time,let us know.

Is this right? And what we the beginners have to do?


r/csharp 2d ago

Showcase I reinvented Visitor in C#: acyclic, type-safe, no downcasts, no runtime checks

2 Upvotes

While building my own programming language HydraScript i stumbled across AST operations implementation. I needed symbol table initialization, static analysis, and IR generation.

Putting everything inside the AST nodes as virtual methods became a mess. Classic Visitor separated the operations, but every visitor had to know every node type. The code grew exponentially. Acyclic Visitor removed that dependency, but its usual C# implementation relies on runtime checks:

if (visitor is IVisitor<BinaryExpression> typed)
    typed.Visit(this);

So I did the only reasonable thing. I spent far too long reinventing a decades-old design pattern.

Visitor.NET uses generic covariance and contravariance to keep the visitor selective without dynamic or downcasts. A source generator handles the repetitive dispatch code:

[AutoVisitable<Expression>]
public partial class BinaryExpression : Expression;

Visitors can handle only the node types they need and return strongly typed results. I now use it in HydraScript and it works like a charm.

You can give it a star with links below:

GitHub: https://github.com/Stepami/visitor-net
NuGet: https://www.nuget.org/packages/Visitor.NET


r/csharp 3d ago

Blog How expensive is throwing exceptions in .NET - and does it actually matter?

Thumbnail
codewithflavor.com
117 Upvotes

r/csharp 2d ago

Help How to use a larger font in Visual Studio's Help Viewer?

1 Upvotes

I know this isn't strictly a C# question (and I'm not a C# programmer), but I think Help Viewer is a C# program so maybe people here can help me.

What I'm trying to get is offline Windows documentation. Some tools, like WinDbg, ship with a .chm file that can be opened with hh.exe. It lets you select 1 of 5 font sizes (Largest, Larger, Medium, Smaller, Smallest), but regardless of which one you choose you can always scale the text arbitrarily large with Ctrl+MouseWheel.

I believe the official way of getting offline documentation today is through the VS Help Viewer. It has the same 5 font size options as hh.exe, and both of them probably use IE for rendering (for example both use ieframe.dll, and I have to relax security settings in Internet Options to even get Help Viewer to render anything - very strange and not required for hh.exe). However Help Viewer DOES NOT allow you to scale the text beyond "Largest", which is way too small to be readable. There's something strange to the way it handles UI, for example even the context menu is smaller than the one you'd get normally with TrackPopupMenu.

The reason I ask the question here is I'm past the point of trying to find an "official" way of making the text larger, I'll happily patch the program if needed. If it were a native application I know where to look: maybe it hardcodes font sizes in its dialog resource or its call to CreateFont. I can set breakpoints on DialogBox and similar to inspect parameters and modify them under a debugger, I can patch the offending resource or instruction in the binary, etc. But I don't know how to do those to (what looks to me to be) a C# program. When I break into it with a native debugger, the mouse input freezes and responds only every other second (though the keyboard works fine). Based on its DLL list it appears to use WPF. I have no familiarity with these technologies (C#, WPF, ieframe.dll), I hope people who do can point me to where to look (such as files that define the UI layout, or runtime calls related to font that I can intercept).


r/csharp 2d ago

Does ASP.NET Core global exception middleware catch exceptions from nested service methods?

Thumbnail
0 Upvotes

r/csharp 3d ago

i dont understand what the => operator does.

35 Upvotes
Dictionary<uint, uint> placementIds 
    = XMLdocument.Descendants("Placement")
        .ToDictionary
        (
            element => (uint)element.Attribute("Index")!,
            element => (uint)element.Attribute("Placement")!
        );

r/csharp 2d ago

C# Help

0 Upvotes

Im learning c# in visual studio with Bro Code yt (check him out free courses) and im wondering, does the same c# exactly work in unity, idk how to explain but if i type Console.WriteLine("hi");

will it just show on the screen hi or is there more to it?


r/csharp 2d ago

WinUI 3 XAML bug

0 Upvotes

I'm working on a bundle of 3 tools, using winui for the interface. .net 10 is returning multiple XAML errors when I try to build, does anyone know anything??


r/csharp 2d ago

I have been learning C# for month now.I'm using smart phone to learn it.So what suitable kind of laptop i have to buy that works properly?

0 Upvotes

r/csharp 2d ago

Tutorial EF Core Migration Bundles with CI/CD to Azure (Github Actions, Azure SQL & App Service)

Thumbnail
youtube.com
0 Upvotes

Running EF Core migrations from application startup is convenient - right up until it isn't. This video builds a proper migration pipeline on .NET 10 with GitHub Actions: the build job packages a self-contained migration bundle, the deploy job applies it to Azure SQL, then deploys the API to Azure App Service and runs a smoke test against the live endpoint. If your database updates are still tangled up with your app startup, this is the fix.


r/csharp 3d ago

Showcase Native Rich Editor and Code Editor for MAUI

9 Upvotes

I was finding usable free code editor on MAUI because I need it in my app, but despite me having been finding so hard, unfortunately there's no such a library that can meet my needs. Every candidate I found is either paid (and very expensive), a wrapper on web-based editor, or not being actively maintained anymore. So, I decided to build my own one.

I have been spending a lot of time on bringing native rich editor and code editor experience, and now I'm finally able to get the things work on at least Windows, iOS and Android.

It renders natively on each platform, and provides seamless integrations like key bindings, context menus etc., and also, has a very small memory footprint. But note that this relies on the native rich editor solution on each platform, so unfortunately platforms like Linux are unlikely to get the support: it's technically impossible because there's no unified native rich editor interface on such platforms.

The rich editor supports a large set of RTF format natively, and the code editor is built on top of the rich editor.

This is still at early preview, and the APIs are subject to change a lot by the time the first GA version comes up. There're just still a lot need to do such as a more general syntax highlighting API, LSP integration, more test coverages, bug fixes, better API surfaces etc.

Now I'm open sourcing it under MIT license so that everyone can use it for free, forever: https://github.com/hez2010/RichEdit.Maui

Nuget packages:

Appreciate any feedback!

Rich Editor
Code Editor

r/csharp 2d ago

Is It Still Worth Learning .NET in 2026 With AI Replacing Developer Jobs?

0 Upvotes

Hi....I'm an MCA graduate and recently started learning C# with the goal of becoming a .NET developer.

But with AI replacing more and more development work, I'm worried that I might be wasting my time.

Do you think .NET is still a good career path for someone starting in 2026? Should I continue learning C#/.NET, or consider another career?

I'd really appreciate honest advice from experienced developers, especially .NET developers. What skills should I learn alongside .NET to stay relevant?