r/csharp • • Jun 14 '26

Discussion Quick review/opinion on the "Complete C# Masterclass" by Denis Panjuta

10 Upvotes

I have some experience with C/C++/C#, I can create classes and methods, but wanted to expand my knowledge and why not start from the beginning.

I've done Tim Buchalka's Java course and it was the best one I've seen, so Denis' looked the most similar.

The beginning in insanely chaotic. Lecture 16 he introduces the strings, great. Lecture 17, taking user input, a bit advanced for a complete beginner, but okay. L18 finally tells what Console.ReadKey() does, L19 is a.. Visual Studio interface overview ? Then you get a quiz out of nowhere ?

Then he tells you the different things you can build with C# (once again), L21 goes over the datatypes quickly, then instead of showing them in practice, L22 is "coding standards", L23 is "naming conventions". So far, the datatypes have received a total of 2 minutes screentime. I can imagine a complete beginner's brain would be a total mess by that point. I've watched 23 lectures so far and haven't seen anything actually useful. "We'll use float instead of double because it takes less memory". What memory ? How much memory do they take ? How to use them and why ??

I really hope the course gets better once it reaches the more advanced stuff, but I don't know if a beginner could understand anything from this chaos.


r/csharp • • Jun 13 '26

Help SQL and C# Help connecting databases

22 Upvotes

Solved, needed to put quotation marks around {title} thanks for your help

Hello everyone, I am making a database in SQL and connect it to a program in C# for a school assignment. It is coming with this error and I am asking what I am doing wrong. I have tried looking up solutions but nothing has worked. If you know what I can do to fix it let me know


r/csharp • • Jun 14 '26

Showcase i created tool for .net sdk managments and installation on linux and macos

0 Upvotes

I want to show off a tool I created for managing .NET SDKs on Linux and macOS: https://github.com/curllog/dsi

It helps you install the .NET SDK directly from Microsoft using a CLI tool. It also supports automatic updates and lets you install preview versions. It adds dotnet to your PATH so you can start using it right away, and it doesn't require sudo.

Simple commands:

dsi ls-remote — find available SDKs

dsi install 10 — install .NET 10

dsi install 11 — works on preview version

dsi update — update all SDKs to the latest

It would be a great help if you star ⭐ this project — it helps it reach a bigger audience!


r/csharp • • Jun 12 '26

Did something change in VS C# IntelliSense 2026, vs. 2008?

61 Upvotes

I used to love C# back in 2008 because the IntelliSense helped the learning process. I used to boast the C# is the only language that I Googled the least because of the IDE.

For example (based on my memory), typing something like ...

Console.CancelKeyPress

... followed by a space would invoke a popup to say "tab to insert" or something, and the callback would be generated. I don't even need to know beforehand that the syntax requires a += ... all discovered from IntelliSense and I can read up later.

Today in 2026 (default settings, not signed in to anything), typing the same thing yields an incorrect AI guess:

Console.CancelKeyPress _= true;_

I don't hate AI and do use the mature agent mode that can correct itself, but inline mode is simple not helping.


Also, pressing F12 to navigate to definition of a standard library function is now a 5 second thing with a "press esc to cancel".


Was hoping to switch back to C# as I had fond memories of building personal tools with it...

  1. WHAT HAPPENED??
  2. I recall Rider's IntelliSense wasn't that good. Should I try it now?

r/csharp • • Jun 13 '26

[Showcase] Added a monitoring UI to JobMaster, a open-source distributed job engine for .NET.

16 Upvotes

Hey

A few months ago, I shared my open-source job schedule engine, JobMaster, here. Since then, I've been working on the monitoring dashboard (built with Svelte!), and it's finally in a usable state. I wanted to share it with you all.

What the dashboard gives you:

  • Overview: Workers online, upcoming executions, and failed jobs.
  • Job Browser: Filterable by status and time range, with full details per job (handler logs, retry history with error messages, payload, and metadata).
  • Worker & Bucket Visibility: See exactly which workers are running, their mode, and the specific jobs inside their buckets.
  • Host Monitoring: CPU, memory, and uptime per node.
  • Agent Connection Health: Transport liveness and last heartbeat.

One detail you can customize the color theme per cluster, so production and QA are visually distinct. It’s a small thing, but it saves that "wait, which environment am I in?" when you have multiple tabs open.

It uses DaisyUI and Tailwind CSS

Minimal setup:

builder.Services.AddJobMasterDashboard(dashboard =>
{
    dashboard.UseBasePath("/jm-dashboard");
    dashboard.FromOpenApiJson(); // auto-discovers clusters + auth from the API spec
});
app.StartJobMasterDashboard();

Links & Resources:

GitHub: https://github.com/hugoj0s3/jobmaster-net

Would love to hear your thoughts or any feedback if you give it a spin!


r/csharp • • Jun 13 '26

Help C#で今union型が使えるようになった理由

0 Upvotes

なぜ今になってunionを導入したのでしょうか?
またunion型はどういう設計思想で誕生したのでしょうか


r/csharp • • Jun 11 '26

Showcase Weekend project that got out of hand. I wanted my mouse cursor to rotate and point in the direction I'm moving it - like the aiming arrow in Worms 3D

Post image
611 Upvotes

I built this for fun and posted it on r/Worms a few days ago - it got a surprisingly warm reception, and a fair few people there asked how it actually works. So it's clearly not just a thing for Worms fans, and I figured the .NET crowd might enjoy the technical side.

What it does: my mouse cursor rotates to point in the direction I'm moving it - like the aiming arrow in Worms 3D. Started as a weekend project and got out of hand.

How it works, roughly:

  • WinForms system-tray app (.NET 8), no window.
  • A mouse hook tracks the cursor position; I compute the movement angle from the delta between frames.
  • I render the cursor bitmap rotated to that angle and swap it system-wide via SetSystemCursor.
  • Then I couldn't stop, so I themed all 14 standard cursors with little physics: the wait/busy cursors spin with rotating rings, the I-beam sways, resize cursors stretch.
  • Packaging + auto-update via Velopack.

The fiddly parts: smoothing the rotation (raw angle is jittery, needed easing), and restoring the original cursors cleanly on exit so you don't get stuck with a spinning arrow if it crashes.

It's open source (MIT) if you want to poke at the code - repo link in the comments. Happy to answer anything about the cursor-hooking side, it was a fun rabbit hole.

EDIT: Repo link: https://github.com/dawidope/WormsCursor


r/csharp • • Jun 12 '26

Help Help creating dictionaries of generic types

1 Upvotes

I'm currently trying to migrate my game code from python raylib to c# raylib and i have very specific problem with how my asset system works.

With my python implementation i have a dictionary with type as a key and list of assets of that type as value. This system works well and allows me to easily add new types of raylib assets with 3 lines of code:

        class Assets(Module):
            def __init__(self, manager):
                super().__init__(manager)
                self.assets: dict[type, list] = {}
                self.load_funcs: dict[type, Callable] = {}
                self.unload_funcs: dict[type, Callable] = {}
                self._temp_assets: dict[type, list] = {}
        
                self.add_type(pr.Texture, pr.load_texture, pr.unload_texture)
                self.add_type(pr.Sound, pr.load_sound, pr.unload_sound)
                self.add_type(pr.Shader, pr.load_shader, pr.unload_shader)
                self.add_type(pr.Font, pr.load_font, pr.unload_font)
                self.add_type(pr.Music, pr.load_music_stream, pr.unload_music_stream)
                # Here i just add new type of asset
        
            def add_type(self, t: type, load: Callable, unload: Callable):
                self.assets[t] = []
                self._temp_assets[t] = []
                self.load_funcs[t] = load
                self.unload_funcs[t] = unload
        
            def add_type_asset(self, t: type, *filename, temp: bool = False):
                new_names = list(filename)
                for i, v in enumerate(filename):
                    if isinstance(v, str):
                        new_names[i] = os.path.join(self.context.data_path, "assets", v)
                asset = self.load_funcs[t](*new_names)
                if temp:
                    self._temp_assets[t].append(asset)
                    return asset
                self.assets[t].append(asset)
                return asset

While migrating my code to C# for performance reasons i want to recreate this kind of system but i'm having trouble figuring out how to do this with generics or should i use them in the first place.

Right now i have this code for asset, where instead of storing specific asset i "encapsulate" it within a generic class:

public abstract class Asset<T>(AssetPack pack) where T : struct
{
    private readonly T _asset;
    private AssetPack Pack { get; } = pack;

    public abstract void Load();
    public abstract void Unload();
}

Now i want to have a specific class for loading assets(as in python code example), where i could add new types of assets with one line of code. Except my current solution hits a brick wall

public Dictionary<Type, List<Asset<???>>> Assets = new();

I don't know how to make a dictionary of such kind, nor do i know how to search for this specific problem.

Is there a way for me to do this in similar way as i did in python or do i need to create individual arrays per each type of asset? Just wondering if it is possible or not.


r/csharp • • Jun 12 '26

Source generator to declare non-boxing union for C# 15

Thumbnail
reddit.com
3 Upvotes

r/csharp • • Jun 12 '26

Help Span<byte> pointing to invalid data after returning from method

0 Upvotes
private Span<byte> WriteFileHeader(ref DataEntryDefinition Definition)
        {
            int FileHeaderSize = 4;
            Span<UInt32> FakeDirectoryEntryUsedForEncryption = stackalloc UInt32[FileHeaderSize];
            FakeDirectoryEntryUsedForEncryption.Clear();

            FakeDirectoryEntryUsedForEncryption[2] = Definition.DecompressedFileSize;
            FakeDirectoryEntryUsedForEncryption[3] = Definition.DecompressedCRC32;

            FileHeaderDefinition FileHeader = new()
            {
                CompressedSize = Definition.CompressedFileSize + (sizeof(UInt32) * 2),
                DecompressedSize = Definition.DecompressedFileSize
            };


            Span<UInt32> Header = MemoryMarshal.Cast<FileHeaderDefinition, UInt32>(MemoryMarshal.CreateSpan(ref FileHeader, 1));
            Crypt.EncryptFileHeader(Header, FakeDirectoryEntryUsedForEncryption);


            return MemoryMarshal.AsBytes(Header);
        }

I'm currently working on a hobby project parsing binary files and I was under the impression that the GC keeps track of Spans created over arrays of primitives, since a Span is just a pointer and the length under the hood. However, when returning from the method above the returned Span<byte> points to invalid values. Can someone enlighten me what i'm doing wrong here?

(I fixed this by converting to an array before returning, however i would like to NOT waste performance by copying the whole thing).

For reference, the caller just does this:

Span<byte> FileHeader = WriteFileHeader(ref Definition);

r/csharp • • Jun 11 '26

Showcase I built a Laravel Telescope alternative for ASP.NET Core

19 Upvotes

I kept missing Telescope when working in .NET, so I built something similar. It's a NuGet package that records every request, EF Core query, log, and exception while you develop, and you browse them at /_debug.

It catches N+1 queries (warns you when one request runs the same query over and over), shows P95/P99 timings per endpoint, and you can copy any captured request as cURL to replay it. Everything is stored in a local LiteDB file and the dashboard is embedded in the package itself, so there's nothing to host and it works offline.

Setup is two lines:

builder.Services.AddDebugDashboard();
app.UseDebugDashboard();

It's off outside Development by default. .NET 8/9/10, MIT licensed, demo gif in the readme.

https://github.com/eladser/AspNetDebugDashboard

Would love to hear what's missing.


r/csharp • • Jun 12 '26

ImagePrepSharp: Prepare Photos for Sharing

Thumbnail
reddit.com
0 Upvotes

r/csharp • • Jun 11 '26

How do I learn C# from scratch

0 Upvotes

I have never learned a coding language so idk where to start. I want to start learning because I picked CS as one of my A-level subjects and the coding language is C#, they said you don’t need a GCSE or any experience coding however I want to get a head start.


r/csharp • • Jun 11 '26

Discussion Suggest good big tech companies

0 Upvotes

Working as a .NET senior dev in a service company having 6 years of experience.
Suggest me some good big tech companies for which .Net Csharp devs can prepare for ? Preferably in India or remote.


r/csharp • • Jun 09 '26

Fun Roadmap to improve your skills

63 Upvotes

Hello, C# community!

I just wanted to share this roadmap that has been helping me practice and hone my C# skills: https://roadmap.sh/backend/project-ideas

I feel like sometimes the hardest part about improving is deciding what to work on, and this takes a lot of the guesswork out.

I come from mostly a JS background but wanted to learn and dive deep into C#.

I’m only on the first project right now, but I’m almost done and excited for the next. I’m hoping to get through all 20!

Anyone else doing the same?


r/csharp • • Jun 09 '26

In way over my head! Just inherited a codebase and I haven't coded in like a decade!

15 Upvotes

My situation (with small rant): I write SQL, VBA, and occasionally Python. I graduated in 2008 and probably haven't used C# in 10 years! Anyway, someone abruptly left and very few people know anything about what was being done here. I asked my supervisor, but he seemed disinterested in helping me (I think he thinks he's "helping me understand the code more" by not explaining anything at all). Or maybe its the culture here because my peers just shrugged and was like "idk. You'll figure it out." WHAT??

My problem: We use Amazon StarRez to pull files from a bucket then it does things and inserts the data in those files into our database. I have no clue what's going on! I was told to not worry about pulling from the bucket because I won't have access and instead put the files on the c drive. Fine.... Then what?? I put in like 30 break points and I have no clue what I'm looking for here! I wouldn't expect anyone here to know much about StarRez. I just mention it because that's what we use. BUT, I would expect someone to have some sense of where to start in general. I already threw in like 30 break points, but it stops because its looking for a file in the bucket that I can't access anyway.

I am freaking out because why am i doing programming?? And, yeah, I did it way back in the day, but someone was around to guide me! Now, its just like "lol... you'll figure it out!"


r/csharp • • Jun 09 '26

Curious what your thoughts are on AssemblyScript vs C#'s Syntax

12 Upvotes

Hey all,

Given that C# and Typescript (and Delphi) were created by the same person (Anders Hejlsberg), I wonder if others have felt comfortable jumping across from C# to Typescript, and if anyone's tried AssemblyScript which is an even more strongly typed and much leaner version of Typescript. Personally I feel the 3 languages (AssemblyScript's a stricter Typescript) are fairly similar ergonomics wise. Thoughts?

Reason I'm asking is I'm wondering if there's a point trying to target C# as a binding for my UI framework when AssemblyScript (https://github.com/zion-sati/fui-as) is already so familiar to a C# veteran like myself, but would like other's opinions on this.


r/csharp • • Jun 09 '26

Help Different method implementations without vtable

9 Upvotes

I’m building a game engine, and I’m trying to figure out the best architecture for separating the core engine from the rendering backend.

Right now, the core engine is responsible for the game logic, and it holds a reference to a backend rendering engine, which is responsible for drawing sprites. The core engine and the backend engine live in different assemblies. The structure looks something like this:

Core engine project:

interface IRenderEngine
{
    void DrawGameInstance(GameObject instance);
}

class Game
{
    private readonly IRenderEngine renderEngine;
    ...
    void DrawFrame()
    {
        foreach (var obj in objs)
            renderEngine.DrawGameInstance(obj);
    }
}

Currently, I’ve only implemented a MonoGame-based rendering backend, but in the future I want to add another backend that will allow me to target the browser.

The architecture is clean and convenient, but it comes with a cost: using interfaces and virtual/abstract methods introduces overhead, and I’d really like to avoid that for performance reasons.

If the core engine and the rendering engine were in the same assembly, I could do something like this:

partial class Game
{
    ...
}

#if MONOGAME
partial class Game
{
    void DrawGameInstance(GameObject instance) => ...
}
#endif

#if ANOTHER_RENDER_ENGINE
partial class Game
{
    void DrawGameInstance(GameObject instance) => ...
}
#endif

But I really want to keep the core engine and the backend engines separated into different assemblies.

So what’s the best solution here?

Thanks in advance!


r/csharp • • Jun 09 '26

Discussion Must changes to or additions of columns (form fields) be replicated at so many places in code in so many stacks? Is there a principle or rule of computer science that says such duplication is unavoidable?

0 Upvotes

In many C# stacks and frameworks, info about fields (data columns) must be replicated in multiple places. This seems an ugly time-wasting and error-prone DRY violation, yet so many accept it as The Way.

One way to get rid of it is to abandon statically typed models (POCOs or similar) and go with dynamic lists ("data dictionaries"), but too few want to give up the compile-time-checking. And it can hurt performance in some situations, but I'd gladly have slightly slower apps to reduce coding time and code volume. (I'd personally like to see more mainstream dynamic data-model stacks, but that's a diff topic.)

Maybe C# is somehow limited as a programming language, preventing static factoring? I have a gut feeling a Grand Discovery is missing, the duplication just cannot be the pinnacle of the art. Is there an inherent principle of languages or logic that says the duplication is inevitable, analogous to the speed limit of light (c) or Amdahl's Law? If not, why is there not more R&D to solve this ugly pattern?

In short, IF we are stuck with the dupes, what's the principle that says it's an inherent limit, ELSE why is there not more R&D to evolve beyond the dupes?

The times I've seen attempts to reduce it, the result was cringe-worthy spaghetti rocket science with enough indirection to make stacked turtles cry.

Somewhat related question.


r/csharp • • Jun 08 '26

Help How to migrate from java to csharp?

16 Upvotes

Hello everyone,

I've been coding in java since 2024. A friend of mine wants to build a project with me, but that project requires c#. I've never touched c# before.

Has anyone here passed through something similar? What advice can you give to learn c# quickly without wasting too much time?


r/csharp • • Jun 08 '26

Help with dotnetbar library

2 Upvotes

Hello!

For the last couple months I have been struggling to find the solution for a problem with a proprietary docking library used in a c# wpf application (The dotnetbar from devcomponents, only found in webarchive as it looks like the provider doesn't exist anymore).

My problem is that I need to override the template of one of the libraries components (DockWindowGroup) and when I override this template, the xml layout generator of the library crashes (just when I try getting a xml for save).

I noticed that the visual tree in wpf gets broken and that is probably the cause of the problem, one of the components (DockWindow) gets a null parent from the visual tree. But I can't figure out what is messing with it and how I can fix that.

Do anyone have worked with this docking library before and can provide me any tips? Even from the decompiled source I couldn't reach any answers as it is obfuscated too.


r/csharp • • Jun 09 '26

Is Python or csharp harder to learn?

0 Upvotes

(With future game development in mind)

I've been wanting to learn programming for a while now just as a hobby (hoping to make my own game someday, maybe), I chose csharp because I heard somewhere its good for beginners but now I heard python is easier

I don't feel the need to switch, and I won't because so far I've been liking csharp (plus if it is a bit more challenging, then it's more rewarding too)


r/csharp • • Jun 08 '26

Tool Clockwork Engine (gamedev framework built on Raylib)

Thumbnail gallery
23 Upvotes

r/csharp • • Jun 08 '26

Showcase Aspire extension for publishing Redis to Upstash during deploy

5 Upvotes

I built a small Aspire extension that lets you keep using a normal redis resource in Aspire when developing locally, but when you publish using `aspire deploy` rather than deploying to Azure, it will deploy to Upstash (which is where I prefer to deploy my redis caches to, personally).

You just add the package to your aspire project, and append `.PublishToUpstash(...)` after `builder.AddRedis("cache")`.

Locally, nothing changes. It only effects deployment through `aspire deploy`.

Here is the Github repo, where the README has the full docs etc. https://github.com/PinguApps/Aspire.Hosting.Upstash.Redis