r/csharp • u/Shattered-Spears • 1h ago
Discussion What's your most favorite project you have made?
I was wondering what are your most favorite projects you have made using C#? And how did you plan their architecture?
r/csharp • u/Shattered-Spears • 1h ago
I was wondering what are your most favorite projects you have made using C#? And how did you plan their architecture?
r/csharp • u/Userware • 1h ago
We recently updated XAML.io to .NET 11 and C# 15, so we put together five short examples covering union types, closed hierarchies, collection expression arguments, extension indexers, and labeled break/continue.
Each example has a brief explanation and some code you can modify. The editor and output are side by side. C# compilation happens entirely in the browser (WebAssembly). Here's the link to the C# 15 examples in the browser-based playground:
https://xaml.io/s/Samples/CSharp15Examples?autorun=true&file=StartHere.cs
r/csharp • u/Alert-Neck7679 • 3h ago
If I understand it correctly, when you write Debug.Assert(value) it's only included if debug mode is enabled, but not when it's release mode.
So, what happens if I pass an expression as the argument to this method? Let's say it's a function call, would it be executed on release mode? Or should this:
Debug.Assert(ImportantFuncWhichReturnsBool());
Become this:
bool value = ImportantFuncWhichReturnsBool();
Debug.Assert(value);
Thanks in advance
r/csharp • u/davidedalcortivo • 4h ago
r/csharp • u/LosIdiotas • 6h ago
I've made this post: https://www.reddit.com/r/csharp/comments/1xhmfnf/any_good_crossplatform_windows_macos_linux_c_gui/ but it keeps getting deleted, what am I doing wrong??
r/csharp • u/RammerOfProgs • 9h ago
r/csharp • u/BladeRunner_2029 • 14h ago
What's the roadmap of become web developer in a c# . Is it worth learning in this AI era.
Hi all, I'm trying to diagnose a SAP Business One DI API connection error and would appreciate any insights.
Type.GetTypeFromProgID("SAPbobsCOM.Company")I'm setting the following properties before calling Connect():
Server (IP)CompanyDBUserNamePasswordDbServerTypeLicenseServer (Usually defaults to same with server)UseTrusted = falseCompany.Connect() returns -226.GetLastErrorDescription() returns: The specified resource name cannot be found in the image file.COMException (0xFFFFFF96) with the message: You are not connected to a companyI had once achieved a connection against another database, can't seem to point out what the outstanding issue now is.
Any pointers to the specific cause or recommended troubleshooting steps would be appreciated. Thanks!
I'd like to hear what you currently use for audio in C# FMOD, Wwise, raw XACT/wrappers, and what annoys you about it, especially if you target WebAssembly.
r/csharp • u/asenhae12345678 • 1d ago
Title.
I'm looking to learn C# but all the courses that I found online are for beginners.
r/csharp • u/HouseOwn392 • 1d ago
So I’ve kept been told AI is the next step and I need to keep up with it but I’ve never really know where to start. I know how to use ChatGPT and Claude on my web browser that’s it.
So I’m curious as to what Csharp developers really use for their AI workflow and are there any tutorials out there that are solid and I can learn.
Edit: what’s up with the downvotes on my fellow AI users? Yall got a thing against AI?
r/csharp • u/shanewas726 • 1d ago
r/csharp • u/Top_Marionberry_4413 • 1d ago
I did it initially because Helix seems to not want to add plugins to their editor, making it not very extensible, which is a shame. And Helix lacks a lot of features that would be useful.
Dependency-free (aside from NLua) architecture, no Terminal.Gui library dependency, written from scratch with C#.
r/csharp • u/marsh9191 • 1d ago
Today, I stumbled upon a 100-line unit test. Due to my inability to understand the name AreMatchingGuestsNotRequiredUnlessTheyAreNotUnmatching, I stripped away all the noise to figure out what it was actually testing.
This is what it essentially boils down to:
[Fact]
public void AreMatchingGuestsNotRequiredUnlessTheyAreNotUnmatching()
{
// Arrange
var first = new Trn { Guests = 2 };
var second = new Trn { Guests = 2 };
// Act
var areMatchingGuestsNotRequiredUnlessTheyAreNotUnmatching =
first.Guests != second.Guests
|| first.Guests == second.Guests;
// Assert
Assert.True(areMatchingGuestsNotRequiredUnlessTheyAreNotUnmatching);
}
Here's what the test actually does:
I was quite surprised that the test name actually matches what the test does.
Or does it?
r/csharp • u/Hertzole • 1d ago
Hey all!
I've recently gotten my small utility library for source generators to a state where I feel comfortable sharing it.
The idea is simple: I want to reuse utilities for my source generators, like a library, without having to include extra dependencies. So I just generate the utilities directly into the source generator!
For regular NuGet this probably doesn't matter much, but it may matter more when developing with Unity, as I personally mostly do. In my Unity libraries I don't want to include a shared library that multiple packages may depend on and conflict with.
So what does it do?
What about assembly size?
SourceGen utils includes a trimmer that runs automatically on build (can be disabled if you want) that removes all unused types, methods, properties and fields from SourceGen Utils. It just used Mono.Cecil to go through all the method instructions to see if something is used or not. So you only include what you use!
I've made sure to include tests for nearly all generated methods to make sure they all do what they are supposed to and that the trimmer won't remove anything that you actually use.
The project is open source, licensed under MIT, and available on NuGet. I've also created documentation so you can see what it has to offer!
Feel free to give feedback on the project and maybe even use in your own generators! :)
AI disclosure: AI was used to create the method usage detection and for validating documentation, but everything else is human made!
r/csharp • u/Mob_Pilled • 2d ago
r/csharp • u/nuclearbananana • 2d ago
I've been working on Satori Insight, a desktop app for exploring .NET memory usage and GC behavior. Built with Avalonia and NativeAOT.
The initial idea was a defrag-style map of the managed heap, where each block represents a region. It grew into a profiler that combines continuous telemetry with deeper heap inspection.
Some of the features:
It supports standard Workstation and Server GC as well as Satori GC of course (see the name of the app).
It's now open-sourced at GitHub:
https://github.com/hez2010/SatoriInsight
You can try it out by downloading the binary for your platform from GitHub Releases.
r/csharp • u/harrison_314 • 2d ago
When did you first realize that C# is magic? Or when did you realize that C# is right for you?
Back in the days of the .NET Framework 4.0, I first encountered WCF, you call an interface on the client, and it executes the implementation on the server. At the time, my head was spinning because there was no code around it that was sending anything,it just happened on its own - magic.
r/csharp • u/zarkonnen • 2d ago
I recently updated my OS (Linux Mint), and this seems to have broken NuGet. JetBrains Rider gets stuck in "Loading Projects" when opening a C# (Godot) project. My
~/.nuget/packages directory does not exist and attempting to install packages via e.g. nuget install godot.sourcegenerators -Version 4.6.2 times out.
I don't know what I need to do to get this unstuck.
r/csharp • u/VCVLMNOP • 2d ago
I'm a learner and all but I wanna know if people still use IDE's like visual studio 2026 in actual serious environments, besides or maybe even with AI agentic stuff.
personally I use the latest visual studio (purple one), because I'm still learning how to program and I don't really feel like (for me at least) it's a good idea to let ai code for me just yet.
curious to know your thoughts
r/csharp • u/AMexisatTurtle • 2d ago
Hey guys, I was wondering if anyone has any advice for a beginner learning C#.
I have some coding knowledge with Javascript API with the Foundry VTT program, though I doubt that counts as much or won't help me.
Any help would be greatly appreciated!
r/csharp • u/ShadowGeist91 • 2d ago
Hello, everyone! I’ve been working on a fuzzy logic library for C# called FuzzySharper, and I wanted to show it here, as I put out the first public preview just yesterday.
I started this project a few years ago already, but I've been putting off actually publishing for the longest time, so here it goes. I've been interested in Fuzzy logic for quite a while, and I wanted to focus on usability guided by strong core architectural principles, as I found the options available both in C# and other languages to be lacking.
As to what Fuzzy Logic is: with boolean logic, you might define “young” as “under 30”: someone is young at 29, then suddenly isn’t once he's 30. Fuzzy logic lets “young” be true to a degree between 0 and 1, which can change gradually with age. You can use those degrees in rules like “IF a character IS young AND fatigue IS low, THEN roaming distance IS long.” A game could combine rules like these to decide how far a character wanders based on their age and how tired they are.
The README includes code examples showing how to define these categories, construct rules, and configure inference in the library.
The library currently includes Mamdani inference, fluent rule construction, fuzzy and boolean premises, dependency chaining, configurable operators, and several defuzzification methods. Sugeno inference is still in progress.
This is only an early release targeting .NET 10, available on NuGet under the MIT license.
Very interested to hear your feedback, the library is still in its early infancy, but still quite feature complete regardless.
r/csharp • u/Alert-Neck7679 • 2d ago
The idea is to allow setting a field / property directly from the parameter list, like this:
class MyClass
{
private int A { get; }
private int B { get; }
private int C { get; }
public MyClass(this.A, this.B, this.C)
{
// A, B, C are now holding the values that were passed as arguments
Console.WriteLine($"{A}, {B}, {C}");
}
}
MyClass instance = new(1, 2, 3);
// prints "1, 2, 3"
These constructors can allow being body-less, as long as they don't declare any normal parameters too.
Constructors were always a painful point for me, and even though for some cases you can just use records and skip them, a lot of times you want to add logic or allow different parameter lists, and then you must use normal constructors. I also don't like the primary constructors ( class Bar(int x, int y) ) syntax, which has more problems: the parameters are private fields, so if you want to have a property, you need to declare the property + declare the parameter in the primary conductor + assign the value to the property... too long.
I would love to hear your opinions about this. I build my own scripting language for my C# game engine, and i consider adding this feature to it.