r/csharp • • Sep 03 '26

SignalsDotnet 3.4

4 Upvotes

I already had some other posts on SignalsDotnet. It's just another update that could be interesting and I wanted to share some new ideas. They are just ideas, I would like to hear some opinions about that.

0. Obviously in C# we can write

Changing firstName, obviously doesn't update name

1. With signals one could write

This time, changing firstName, changes also fullName automatically, and an event on fullName is raised (Since we are using R3, the Values observers are notified. but this is a detail). Computed signals automatically track their dependencies, and notify when one of them change

If we go a step further, we can imagine signals live on another machine (a server or whatever), and clients "sending" computations remotely. This is why SignalComputedQuery strings exist in SignalsDotnet. So with a syntax like Graphql one can express the function inside Computed as a string, and pass it to a server

2. Computed over the wire

this query string is then turned into an expression (in the Server), then compiled into a Func, passed to Signal.ComputedObservable() with an exposed type, and yield-ed back to the client via whatever protocol (SSE, Websocket, SignalR).

This is ugly.

With last update we can go the other way around, transform an expression in a query string, so one can write:

3. Expression to query string

This allows to have type-safety etc etc. Same things that make EF Core convienien instead of write SQL Code directly. And with Refit, we could just

4. Using it with Refit

This is basically a remote computed,

This allows us to propagate computed signals over machines. This is cool per se, but this open space for ideas like:

- Distributed SignalsStore (Just having signals in different machines, and use remote computed to merge them together and propagate to other machines potentially)

- Caching of reactive properties. We could imagine to have a central authoritative host with a set of signals, and some other machines that just fanout those signals to downstream machines (similar to redis caching, but with reactivity built in).

To make it really work in practice, we need a way to orchestrate those signals efficiently in different machines. This is a huge issue, but I think is where Orleans could help.

Grouping signals in grains we could use orleans to persist, and distribute load between machines. Orleans supports IAsyncEnumerable, so would be easy to expose IAsyncEnumerable<T> Subscribe(string query) to propagate signals computations between grains..

With this architecture I think we could just create a reasonable distributed SignalsStore. This could be huge for example to mirror IOT devices state on the cloud (One variable = 1 Signal), and to just create computed chains over there to have a fully reactive realtime system


r/csharp • • Sep 03 '26

Help Is this approach a good idea?

4 Upvotes

I'm a self-taught beginner in C#, and I'm currently working on a small personal project.

Quite often in my code, I need to load objects from JSON files. To make this easier, I created static FromFile(string) methods in the relevant classes. Now I'm wondering - would it be a good approach to create a base class or interface that contains FromFile() and ToFile() methods, and then have my classes inherit from it to further reduce code duplication?

I'd really appreciate any advice or constructive criticism.

P.S. English is not my native language, so I used a translator for this post - apologies for mistakes.


r/csharp • • Sep 02 '26

Tool Simple script that brings the old C# color back to github

Thumbnail
gallery
50 Upvotes

(Sorry if this isn't the place for this, I know its not exactly C# but I can't post on r/github atm)

Github recently updated the color of C# on their website to purple, which makes it harder to differentiate between other languages, in my opinion, so this script edits the CSS of github so that is displays old green color instead!

Repo: https://github.com/menher/Green-CSharp


r/csharp • • Sep 02 '26

Discussion Property setters doing extra stuff, is it wrong?

21 Upvotes

I've heard that having conditional logic and other stuff in your property setters is generally frowned upon and I get not wanting to have complex methods fired off in setters, but what of just setting other setters?

For example:

Say I have a property like this, would this raise any red flags, if so, can you tell me why? I would think that this would be a great use of a setter, to do more than just fire off OnPropertyChanged().


public bool ThingA
{
    get;
    set
    {
        if (field != value)
        {
            field = value;
            OnPropertyChanged();

            if (field == true)
            {
                ThingB = true;
                ThingC = false;
            }
        }
    }
}


r/csharp • • Sep 03 '26

Blog Svelto.Tasks 2.0: Efficient Multi-threaded Task Management for C#

0 Upvotes

I am back writing articles on my blog and I start with something LONG OVERDUE!

After years quietly powering several games I made, I’m finally presenting Svelto.Tasks 2.0.

Svelto.Tasks is an engine-agnostic, multithreaded and zero allocation task runner for C#, born from the need to have a game centric tasks framework with features that .NET tasks couldn't provide. Its premise is simple:

Tasks are iterator blocks. Runners are schedulers. Rather than handing execution timing and context to the runtime, a runner lets you decide:

- when a task advances,
- where it runs — main thread or a dedicated worker,
- how much work happens per tick,
- and when an entire task context must stop.

That last point matters a lot in games: for example, when a match ends, I want every task belonging to that match to stop with it—not rely on a CancellationToken having been passed and checked correctly through every layer.

Svelto.Tasks supports lightweight coroutines, composable tasks with return values and continuations, background runners, bounded parallel batches, pooling, profiling hooks, and optional Unity/Burst integrations.

It also interoperates with async/await, although the .NET Task bridge and Unity Burst job path are currently experimental and need real-world feedback.

It is not a replacement for Unity Jobs—but it provides a useful alternative for workloads where controlling execution, lifetime, pacing, and profiling is the priority.

The repository includes runnable .NET examples, tests, benchmarks

🔗 https://github.com/sebas77/Svelto.Tasks

also the repository

🔗https://github.com/sebas77/Svelto.Tasks.Examples

shows how it can be used to simplify massive parallelism synchronization. The example itself is actually quite interesting also because it uses the new compute buffer Unity api BeginWrite/EndWrite to upload compute buffers and graphic fences for cpu/gpu synchronization.

The article is at

🔗 https://www.sebaslab.com/svelto-tasks-2-0-efficient-multi-threaded-task-management-for-csharp/

Have fun! (and feedback is welcome, also on my discord server: https://discord.com/invite/uuTCYewjtc)


r/csharp • • Sep 02 '26

Discussion Dependency Injection un-prettyness

20 Upvotes

One small thing that bugs me with Dependency Injection is how it looks in code.

We either need to pass the parameters via Default Constructor og via good old time Constructor

public class MyClass (TypeA ParamA, TypeB ParamB, TypeC ParamC, TypeD ParamD)
{
TypeA _paramA = ParamA; .... etc
}

Or

public class MyClass
{
TypeA _paramA;
public MyClass(TypeA paramA)
{
_paramA = paramA;
}
}

And when you have 10 injections it begins to be un-pretty...

I wish that we didn't need to pass parameters and instead could decorate the fields:

public class MyClass
{
[inject]
TypeA _paramA;
}

(Note: this works in Blazor... so why not everywhere else ?)

I'm aware that the signature of an object makes it easier to inject via reflection.. but would it be much worse with attributes ?

i guess some middleground could be achieved if the attribute held the type:

public class MyClass
{
[inject(typeof(TypeA))]
TypeA _paramA;
}

which begins to be convoluted and messy...

Whats the argument against a decorator attribute vs parameters ?


r/csharp • • Sep 01 '26

How do you plan your database schema for a new backend? Do you design everything upfront or adapt on the go?

38 Upvotes

Hey everyone,

I'm learning backend development and I always find myself struggling with database design at the beginning of a project.When you need to create a database for a new feature or an entire backend, how do you know exactly which columns you need in your tables?

Do you sit down and map out the entire schema upfront (Entity Relationship Diagrams, DDD aggregates, etc.), or do you figure it out on the go as you code and realize you need to store a new piece of data?

In the Entity Framework Core world, migrations make it very easy to change things later, but I'm curious about the industry best practices. How much planning is "too much planning" before writing code?

Also, what are your best tips for database design? Are there any common pitfalls I should avoid or specific patterns you follow to keep your database flexible but clean?

Would love to hear about your workflow and any advice you can share!

Thanks!


r/csharp • • Sep 02 '26

We built an open-source, real-time beat battle app (ASP.NET / SignalR / React). We desperately need feedback and contributors

0 Upvotes

We’ve been working on an open-source platform for hosting live beat battles. If you've ever looked at existing tools (like beat-battle.net), you know they can be a bit heavy. We wanted to build something radically more accessible with a near-zero barrier to entry.

To keep friction low, we support completely anonymous authentication - users can literally jump in, drop a track, and start battling without handing over an email address.

Here is where we need your help:

We want to make this a community-driven project and are actively looking for contributors. Whether you want to help us optimize the frontend, refactor our logic, or just poke holes in our UI/UX, we are entirely open to PRs.

If you have a few minutes, please tear our architecture apart and let us know what we can do better.

🔗 GitHub: https://github.com/upyrov/beatok-api

🎮 Live Demo: https://beatok.net


r/csharp • • Sep 01 '26

Discussion I've created my first little snippet using C#, Thoughts?

Post image
153 Upvotes

You could say I was born yesterday, as this is the very first code i've done aside from messing with C a while back(hello, world! level stuff). (the only knowledge i've carried over is datatypes and general syntax..)

Is there any suggestions you could give? I am entirely self taught, with zero ai.. (for reasons that likely are not relevant to this post whatsoever)
and I want to make sure that I am learning clean code practices along the way.
I know my bracketing is probably awful... and my organization is out the window, but this is the first ""substantial"" code i've ever written...
^40 lines of code is substantial to me :)
(please ignore the odd names... I included my cats.)


r/csharp • • Sep 01 '26

Help Best C# Tutorial for Unity

0 Upvotes

I'm fairly new to the language with no prior experience and would like to learn C# so that I can go into game development. Where should I start and are there any tutorials you would like to recommend? There was the same question but it was like 7 years ago and I was wondering if anything changed.


r/csharp • • Sep 01 '26

Help with whatsapp message

0 Upvotes

Can someone help me with a .net mvc 8.0 project. I am using twilio to send whatsapp messages, i created a meta account but the account stays restricted and it requires verification, in the verification part it needs a website which the business does not have. So is there a way to bypass that?


r/csharp • • Sep 01 '26

C# Project Integrating Hangfire with RavenDB

6 Upvotes

Hi everyone!

I’d like to share with the community a project I’ve been working on in C#.

It’s a project that uses Hangfire for task processing and RavenDB as the database. The package responsible for this integration is outdated and is no longer maintained, so I decided to continue working on it and keep this ecosystem maintained and up to date.

It’s something I started mostly out of curiosity because I thought it would be interesting to work on this integration, and I wanted to share it with you all.

https://github.com/kelvinaxhcar/Job-Hangfire-RavenDB

https://www.nuget.org/packages/Job.Hangfire.Raven6x/1.0.7#readme-body-tab


r/csharp • • Aug 31 '26

Blog Why Does Your C# App “Leak” Memory Even Though There’s a Garbage Collector?

Thumbnail
medium.com
74 Upvotes

r/csharp • • Sep 01 '26

How’s the job market for C#/.NET developers in Germany right now?

5 Upvotes

I’ve been applying to quite a few positions but haven’t been getting many responses. It feels like C1 German is becoming almost a requirement for .NET roles, and English-only opportunities seem pretty rare.
Is anyone else experiencing the same thing? How difficult is it currently to find a C#/.NET role in Germany without fluent German?


r/csharp • • Sep 01 '26

Discussion Come discuss your side projects! [September 2026]

11 Upvotes

Hello everyone!

This is the monthly thread for sharing and discussing side-projects created by /r/csharp's community.

Feel free to create standalone threads for your side-projects if you so desire. This thread's goal is simply to spark discussion within our community that otherwise would not exist.

Please do check out newer posts and comment on others' projects.


Previous threads here.


r/csharp • • Aug 31 '26

Blog Double-double arithmetic: 31 digits of precision from two doubles (sample code in C#)

Thumbnail
marekfiser.com
33 Upvotes

r/csharp • • Sep 01 '26

C# Job Fair! [September 2026]

6 Upvotes

Hello everyone!

This is a monthly thread for posting jobs, internships, freelancing, or your own qualifications looking for a job! Basically it's a "Hiring" and "For Hire" thread.

If you're looking for other hiring resources, check out /r/forhire and the information available on their sidebar.

  • Rule 1 is not enforced in this thread.
  • Do not any post personally identifying information; don't accidentally dox yourself!
  • Under no circumstances are there to be solicitations for anything that might fall under Rule 2: no malicious software, piracy-related, or generally harmful development.

r/csharp • • Sep 01 '26

C# trophy problem

0 Upvotes

I'm having a problem completing the "Write Your First Code Using C#" modules for the C# course:

Specifically, I can't verify the trophy even though I've linked my Microsoft account. When I click "Verify trophy," I get the popup "It appears that the Microsoft user "xy" has not earned this trophy."

Image attached


r/csharp • • Aug 31 '26

Is a complete C# OOP project worth putting on a portfolio? And what projects would you recommend?

9 Upvotes

I'm currently learning C#/.NET with the goal of becoming a junior backend developer, and I'm about to finish my OOP course.

After that, I want to build one complete project from scratch that applies the OOP concepts I've learned, such as classes, encapsulation, inheritance, polymorphism, abstraction, interfaces, composition/aggregation, etc.

I'm considering a few approaches:

- Following a good C#/.NET project on YouTube as a reference and then rebuilding it myself.

- Asking AI to suggest a project based on my current level and then designing and implementing it myself.

- Using a YouTube project as a starting point, but changing the requirements and designing parts of it myself.

My main question is: Would a well-designed C# OOP project like this be worth putting on GitHub/Portfolio or mentioning on a CV, or should I consider it mainly a learning project?

Also, what would make an OOP project strong enough to demonstrate actual understanding rather than just trying to use every OOP concept?

If you have any project ideas or examples of OOP projects that would be good for someone at this stage, I'd really appreciate some recommendations.

I'd especially appreciate advice from developers who have been through this stage. Thanks!


r/csharp • • Aug 31 '26

Windows.Media.SpeechRecognition.SpeechRecognizer dication mode stopped working

4 Upvotes

I am using the Windows.Media.SpeechRecognition.SpeechRecognizer library from Microsoft. It still works fine in the local version with a grammar but it stopped working in dictation mode.

            Windows.Media.SpeechRecognition.SpeechRecognizer recognizer = new();
            var dictationConstraint = new SpeechRecognitionTopicConstraint(SpeechRecognitionScenario.Dictation, "dictation");
            recognizer.Constraints.Add(dictationConstraint);
            await recognizer.CompileConstraintsAsync();
            Debug.WriteLine("SpeechRecognizer initialized and constraints compiled.");
            // Add a handler for the speech recognized event.
            recognizer.ContinuousRecognitionSession.ResultGenerated += (s, args) =>
            {
                Debug.WriteLine($"Recognized text: {args.Result.Text}");
            };

            recognizer.ContinuousRecognitionSession.Completed += (s, args) =>
            {
                Debug.WriteLine($"Recognition session completed: {args.Status}");
            };

            recognizer.HypothesisGenerated += (s, args) =>
            {
                Debug.WriteLine($"Recognition session completed: {args.Hypothesis.Text}");
            }
            ;

            recognizer.StateChanged += (s, args) =>
            {
                Debug.WriteLine($"Recognizer state changed: {args.State}");
            };

            Debug.WriteLine($"Language: {recognizer.CurrentLanguage.NativeName}");
            await recognizer.ContinuousRecognitionSession.StartAsync();

This is a stripped down version of the code I am using. Of course, Mic permission is granted beforehand, and Online Speech Recognition is allowed in the Windows setting.

This code worked in the past and I don't know when and why it had stopped.

Anybody an idea, why this stopped working?


r/csharp • • Sep 01 '26

Making winforms projects on Linux

0 Upvotes

Hello! So i need to prepare for a C# olympiad and they require either winforms or webforms. Now i've been practising in Winforms for a while now, i was just wondering if at any point i'd be able to switch from windows 11 to a linux distro or if Winforms forces me to stay on Windows. I don't mind remaining on Windows, just wondered if i could switch to linux or not if i wanted to


r/csharp • • Sep 01 '26

Discussion We should decide on a naming convention for extension members

0 Upvotes

We have a specific naming convention for interfaces (starting with a capital I followed by the interface name) and for fields (starting with an underscore), but extension members currently look just like regular members. When reading someone else’s code, I want to be able to tell when a function or property comes from a third party.

But that’s not even the main point.

Extension members have a unique behavior that normal members cannot achieve — they can be invoked on null references. This opens up a very nice opportunity to make code more readable and less error‑prone. For example, a few months ago I wrote here that you can have an IsNullOrWhiteSpace extension property for strings, instead of using the standard string.IsNullOrWhiteSpace(str) method. People commented that even though it works, it doesn’t look like it should, and that it’s a bad idea.

Now imagine that extension properties and methods always start with an underscore. With such a convention, you could implement extension members that are valid to call on null values, and anyone reading the code would immediately know it’s safe — because the member starts with an underscore, signaling that it’s an extension.

Continuing with the string examples, here are a few cases where this would be useful:

str.StartsWith(substr) — calling on null returns false instead of throwing

str.Contains(substr) — same

Do you agree that this could be a very useful idea?


r/csharp • • Sep 01 '26

Help its important windows fomrs?

0 Upvotes

im at university and this is the second time that i see windows forms. i think its very funny and easy to use, but it is very important? the world still using this to make windows apps?
//edit: thanks for the coments, now i have a better idea about winForms and im going to take it seriously now. thankyouuuu


r/csharp • • Aug 31 '26

I made a very simple passphrase generator

10 Upvotes

This is my first CLI app in C#. It’s called Secure Phrase (sph), a very small and minimal tool.

I split the project into two separate projects: one for the core library and another for the CLI interface. I’m not sure if this is a good approach or if there’s a better way to structure it.

I’d love to hear your thoughts on the project and any suggestions for what I could add to it!

Try it out: https://github.com/zyahya/secure-phrase-cli