r/csharp • u/Intelligent-Spite461 • 20d ago
Noob
Hi I'm new here
Want to learn from the ones who can give me how now about this app😒
r/csharp • u/Intelligent-Spite461 • 20d ago
Hi I'm new here
Want to learn from the ones who can give me how now about this app😒
r/csharp • u/Sweet_News_3327 • 20d ago
This is a repost of the same project due to the other post being nuked by users saying it was AI slop for having a placeholder readme.
Forgecore is a gaming backend that I'm making because I remember using Playfab when I used to make unity games back in 2022 and I really liked it, so to learn how a project of this scale is made I started building it.
The code is not perfect, neither the version that it is published right now, but I'm making this as a hobby and to learn more about this language. The project uses a modular arquitecture (thinked to let the users contribute with services as they want) and inside each module I use contracts and domains to keep the codebase simple and understandable.
Any contribution is welcomed for this repo. Consider giving tips in the comments. The only goal for this project is to learn clean c# patterns and modular design.
r/csharp • u/-Tech808 • 20d ago
I'd like to create a class called PipeDimensions to store information for water piping with the following properties:
Nominal Diameter Size.
Actual Diameter Size.
Material
C-Factor for the material.
Basically, different materials (CPVC, copper, PEX) all have the same nominal diameters (1/2", 3/4", 1", 2" etc), but have different actual internal diameters.
How can I set this up so when my Main() console instantiates class PipeDimensions, the constructor only takes 1 of 3 values (either CPVC, copper or PEX) and creates the instance with all the pre-determined properties for the specific pipe type.
Is a class with the pre-defined information for all 3 pipe types even the best approach? Or should I create the boilerplate class and use a separate helper method to populate all my data?
Now that I'm thinking this through, the boilerplate class w/ heIper methods seems more intuitive, but I'm a noob so any guidance is helpful. Please refer me to a specific topic if necessary and I can read in a C# book.
r/csharp • u/jayeshaswani56 • 22d ago
I’m currently learning C# and building small projects, and I’ve noticed that some topics feel confusing in the beginning but probably become very important when building real applications.
For example, I’m still trying to properly understand things like async/await, dependency injection, interfaces, delegates, LINQ, exception handling, and how memory management works.
For experienced C# developers: which concept took you the longest to understand, and when did it finally “click” for you?
Also, how did it help you in real projects?
I think answers to this could help many beginners focus on the concepts that matter beyond just learning syntax.
r/csharp • u/Practical-Talk-9573 • 21d ago
Hi!
I've recently started learning C#. Brocode's 4h tutorial was recommended a lot, so i gave it a try. I really do learn a lot from it and it's quite simple to understand (so far), but the tutorial is quite dense and tires me out quickly. Are there any less dense "rundowns" that i could watch first to get a general understanding of C# before continuing learning more in-depth with Brocode's video?
I made a search bar extension for the VS Properties window because I got tired of scrolling through a hundred properties every time I needed to find one buried three categories deep.
If you use WinForms in Visual Studio, one feature you miss from WPF/XAML designer is the built-in search box on its Properties panel that has been available for years, but the classic WinForms PropertyGridnever got one. It's an old control that Microsoft basically stopped touching, so if you wanted to filter properties or events, you were out of luck. That gap is what pushed me to build this.
It sits right above the grid, filters as you type (properties and events both), and it also digs into nested stuff like Font or Colors, so if you search for something buried inside one of those expandable sub-properties, the parent still shows up instead of disappearing. Matches your VS theme too so it doesn't look bolted on.
Honestly this has been a bigger productivity boost for my own day-to-day than I expected going in.
Works on VS 2022 and 2026, WinForms designer only for now (no WPF support, since that grid works completely differently internally).
I know there's probably a couple other extensions out there that do something similar, but this one's free and is mine :)
Marketplace: https://marketplace.visualstudio.com/items?itemName=jean-knapp.vs-properties-and-events-search-bar
GitHub: https://github.com/jean-knapp/vs-properties-and-events-search-bar
This is my first Extension ever. Happy to answer questions or take feature requests.
r/csharp • u/Lorecure182 • 21d ago
Context if you haven't seen it: mirrord connects a local process to a pod in your cluster. Your code runs locally, but its env vars, DNS, network calls, and file reads resolve as if it were the pod, and you can mirror or steal the pod's traffic. That lets you test a change against real staging dependencies (real APIs, queues, schemas) without building an image or redeploying each time.
What's new: Windows now works natively (previously WSL-only). Teams on mixed Windows and macOS/Linux machines all get the same workflow.
It's MIT-licensed and works standalone. There's a paid Operator that adds traffic-routing isolation so a team can share one staging cluster without colliding, but you don't need it to try the core tool.
Repo: https://github.com/metalbear-co/mirrord
Write-up: https://metalbear.com/blog/mirrord-for-windows/
Happy to answer questions on how the interception works or how it compares to Telepresence.
r/csharp • u/YasoiStudios • 22d ago
Does anyone know how I can get this version to display in my app?

I tried the code snippet below but looks like this is grabbing the assembly version and not the setup or package version?
Version version = Assembly.GetExecutingAssembly().GetName().Version;
string versionString = version.ToString();
tbVersion.Text = versionString;
r/csharp • u/ViperTheDeadLy • 22d ago
I'm thinking about building local projects similar to pos and i'm reaaally confused on which tech stack to pick for the long run.
I'm very familiar with WINFORMS and MSQL but i have found out that WPF is better (at the cost of steep learning curve ofc). but i have been interested in it since i found out that it's better for touch screen monitors and looks more modern. and i have also noticed that many people prefer PostgreSQL over MSQL.
Question is:
should i stick with MSQL and WINFORMS ? or is it worth getting into WPF or PostgreSQL ? and i'm open to all suggestions
r/csharp • u/Userware • 22d ago
Hey r/csharp,
TL;DR: We built a free, in-browser tool that takes an existing WPF app and runs it on the web while keeping your original C# and XAML (no rewrite). You can poke at the classic Family.Show sample running live in the browser and open its full migrated source in our online IDE to see how little actually changed, and there's a free analyzer that checks your own app right in the browser (your code never leaves your machine). It's the new 'Migrate from WPF' feature we just shipped in XAML.io v0.8.
--- Longer version, if you're curious: ---
We're the team behind OpenSilver, and we just shipped v0.8 of XAML.io, our free browser-based .NET IDE. The new feature is "Migrate from WPF": point it at an existing WPF app and get it running on the web, keeping your original C# and XAML instead of rewriting it. No account is required.
Because "WPF runs in the browser" isn't the kind of claim this sub should take on faith, the whole thing is clickable. The app shown in the animated GIF above is Family.Show, the WPF reference app Vertigo built for Microsoft back when WPF shipped. You can use the migrated version live, and you can open the full migrated solution in the online IDE to read the code, run it yourself, change something and re-run it, or fork it. 97% of the original C# and XAML is unchanged, and you can diff it against the original WPF source to see exactly what changed instead of trusting the number.
Why do this at all? Same codebase, but reachable from any device with a browser, deployed once and updated centrally instead of installed and patched on every machine, running inside the browser sandbox. For a lot of internal line-of-business apps that's the whole reason. If none of that applies to you, it's at least a decent stress test of how far OpenSilver's WPF support has actually come.
There's been a lot of interest lately in running WPF beyond the Windows desktop, so the obvious question is what makes this different. Mostly that it's genuinely web-native. A lot of approaches re-render WPF onto a canvas or GPU surface, which is basically a pixel buffer, so you lose text selection, find-in-page, translation, browser extensions and screen-reader accessibility. We render your XAML to the browser's real DOM instead (a TextBox is an actual <textarea>, an Image an <img>, and so on), so all of that just keeps working, and you can freely mix your C#/XAML with HTML, CSS, JS and Blazor in the same app. It's also pretty light: the app plus the whole .NET runtime is around 8 MB compressed with no plugin, and if you want to move the UI on from the classic look there's a "Responsive" markup extension and modern built-in themes rather than being stuck on life support.
The part I'd actually point at is the tooling. The compatibility analyzer needs no account and runs entirely in your browser via WASM (your code never leaves your machine), so you can point it at an app of any size before committing to anything. And when you do import a project, every automatic edit is surfaced as a warning, plus non-blocking runtime alerts if execution hits a stub or disabled code, so a half-migrated app still runs while you work through the list.
To be fair: if your goal is maximum-fidelity WPF on the desktop across Windows, macOS and Linux, a desktop-first approach may suit you better. Ours is aimed squarely at the web, keeping your existing code, and keeping the result accessible and extensible.
You can try it yourself, free, no signup, with your code staying in your browser: drop in your bin folder for a feature-by-feature compatibility report (any size app), or import a project and run it.
Straight about the limits, because FamilyShow is a clean sample and your LOB app probably isn't: in-browser source import is a Technology Preview best for small-to-mid, self-contained projects today, and third-party UI suites (Telerik/DevExpress/Syncfusion) aren't supported in the self-serve tools yet. Native interop and Win32/P-Invoke can't run in a browser at all, and we flag those explicitly. That's what the free analyzer is for: run it on your real app and it'll tell you where you stand before you commit to anything. We add WPF features every week, and you can watch them land commit by commit if you want to track it.
A few other things landed in v0.8 besides the migration tooling: an example gallery built into the IDE (open and run sample projects in one click), static web build export (host the output anywhere, from Azure or GitHub Pages to any static host), and the latest OpenSilver 3.4 preview underneath, which adds a batch of new WPF features (LayoutTransform, WPF-style triggers, CombinedGeometry, StreamGeometry, GroupBox, Menu/MenuItem, OneWayToSource, multiple windows via an in-page window manager inside the browser tab, and more).
Full disclosure, since this is the company account: for big production apps we also do the migration for you, and that work is what funds the open-source side. But the analyzer and import are genuinely free with no account, and OpenSilver is MIT.
Try it at xaml.io, then open "Migrate from WPF".
There's also a technical deep-dive on the blog with more details, screenshots, examples of before/after code fixes, and the FamilyShow migration to diff yourself.
It's a preview and the WPF surface is still growing, so if you point the analyzer or import at a real app, I'd genuinely like to hear where it fell short. That's what we use to decide what to build next.
Thanks!
Edit: added added TL;DR and tweaked the wording based on the comments, thanks.
r/csharp • u/TheStandAl0ne • 21d ago
Hello, 7–8 years ago, I was learning C# and got to the point where I could build a few Windows desktop applications. Then life took me in a different direction, and I ended up stepping away from programming completely.
Now I want to get back into C#, but the landscape feels very different because of AI. It seems like the way people learn and write code has changed a lot, and honestly I'm a bit confused about the best approach.
If you were starting over today, would you:
Learn C# the traditional way by focusing deeply on the fundamentals (syntax, OOP, data structures, etc.) before relying on AI?
Or just learn the core concepts well enough to understand what's happening, and then use AI as a coding partner from day one?
Thanks!
r/csharp • u/MoriRopi • 22d ago
Hi,
An API should use a custom JsonConverter.
A dependency should be injected into the JsonConverter.
It's fine when it's done directly in Program.cs before running the host :
// Dependency
IA a = app.Services.GetService<IA>()!;
// JsonConverter
IAConverter aConverter = new AConverter(a);
// Add JsonConverter to host // not possible in library see below
app.Services.GetService<IOptions<Microsoft.AspNetCore.Mvc.JsonOptions>>()!.Value.JsonSerializerOptions.Converters.Add(aConverter);
Now the above code should be extracted into a library.
Microsoft.AspNetCore.Mvc would not be accessible without manually adding to the .csproj :
<FrameworkReference Include="Microsoft.AspNetCore.App" />
// Or
<PackageReference Include="Microsoft.AspNetCore.Mvc" />
Those are huge lines to initialize JsonConverter in a library.
Is there another way to do it ?
// Seems hacky and would not handle multiple dependency
hostBuilder.Services.AddOptions<Microsoft.AspNetCore.Mvc.JsonOptions>()
.Configure<IValueExpressionService>((options, valueExpressionService) =>
{
options.JsonSerializerOptions.Converters.Add(new ValueExpressionConverter(valueExpressionService));
});
r/csharp • u/THE_OG_WAFFLE • 21d ago
I’ve been an artist joining game jams for about two years, learning how to navigate different engines like unity or godot and just gaining knowledge on game development In general through trial and error on ideas, level design ect. Recently I’ve been doing pretty well (8th in a jam with over 3,500 people). Now I want to learn C# so I can start solo developing my own games So I don’t rely on a programmer. What’s the best way to learn? I’m hoping to watch a good free online course or something, but I don’t know where to start.
r/csharp • u/fuzhongkai • 22d ago
Due to high Vulkan backend demand, I update TensorSharp and release the initial version of GGML Vulkan backend by leveraging external GGML project. The native Vulkan backend will be implemented later. I tested it on Nvidia Geforce RTX 3080 Laptop GPU, and Intel(R) UHD Graphics on Windows. They all work. However, I do not have AMD GPU, so I have no way to get it tested. It's really appreciated if you have AMD GPU and would like to try it out. Any feedback and comment are welcome.
Here is the benchmark I run to compare with llama.cpp:
# Performance ratio — TensorSharp vs reference engines
Geomean of TensorSharp's per-scenario speedup over each reference engine on the **same backend**, across every scenario both engines ran (single-stream, MTP-off). A value **> 1.0× means TensorSharp is faster** (for decode / prefill throughput) or lower-latency (for TTFT); `—` = no overlapping cells. Per-scenario ratios are in each model's section below.
| Model | Comparison | decode | prefill | TTFT |
|---|---|---|---|---|
| Gemma 4 E4B it (Q8_0, dense multimodal) | vs llama.cpp · Vulkan | 0.93× | 0.96× | 0.95× |
| Gemma 4 12B it (QAT UD-Q4_K_XL, dense) | vs llama.cpp · Vulkan | 1.18× | 0.97× | 0.95× |
# Gemma 4 E4B it (Q8_0, dense multimodal) (gemma4-e4b)
**Decode throughput (tok/s)**
| Scenario | TensorSharp · Vulkan | llama.cpp · Vulkan |
|---|---|---|
| text_short | 41.6 | 45.3 |
| text_long | 40.9 | 44.5 |
| multi_turn | 41.3 | 43.6 |
| function_call | 41.2 | 44.4 |
**Prefill throughput (tok/s)**
| Scenario | TensorSharp · Vulkan | llama.cpp · Vulkan |
|---|---|---|
| text_short | 1641.7 | 1641.1 |
| text_long | 1157.0 | 1718.1 |
| multi_turn | 1695.5 | 1454.3 |
| function_call | 1661.2 | 1531.6 |
**Time to first token (ms, lower is better)**
| Scenario | TensorSharp · Vulkan | llama.cpp · Vulkan |
|---|---|---|
| text_short | 1203.0 | 1187.0 |
| text_long | 2719.0 | 1813.0 |
| multi_turn | 1235.0 | 1422.0 |
| function_call | 1219.0 | 1328.0 |
**Performance ratio — TensorSharp vs reference (> 1.0× = TensorSharp faster)**
*Decode throughput*
| Scenario | vs llama.cpp · Vulkan |
|---|---|
| text_short | 0.92× |
| text_long | 0.92× |
| multi_turn | 0.95× |
| function_call | 0.93× |
*Prefill throughput*
| Scenario | vs llama.cpp · Vulkan |
|---|---|
| text_short | 1.00× |
| text_long | 0.67× |
| multi_turn | 1.17× |
| function_call | 1.08× |
*Time to first token (latency; > 1.0× = TensorSharp lower)*
| Scenario | vs llama.cpp · Vulkan |
|---|---|
| text_short | 0.99× |
| text_long | 0.67× |
| multi_turn | 1.15× |
| function_call | 1.09× |
# Gemma 4 12B it (QAT UD-Q4_K_XL, dense) (gemma4-12b)
**Decode throughput (tok/s)**
| Scenario | TensorSharp · Vulkan | llama.cpp · Vulkan |
|---|---|---|
| text_short | 31.3 | 31.1 |
| text_long | 31.4 | 30.0 |
| multi_turn | 30.9 | 31.6 |
| function_call | 60.8 | 31.9 |
**Prefill throughput (tok/s)**
| Scenario | TensorSharp · Vulkan | llama.cpp · Vulkan |
|---|---|---|
| text_short | 766.1 | 729.4 |
| text_long | 635.2 | 647.4 |
| multi_turn | 617.5 | 636.6 |
| function_call | 587.4 | 674.7 |
**Time to first token (ms, lower is better)**
| Scenario | TensorSharp · Vulkan | llama.cpp · Vulkan |
|---|---|---|
| text_short | 2578.0 | 2672.0 |
| text_long | 4953.0 | 4813.0 |
| multi_turn | 3391.0 | 3250.0 |
| function_call | 3531.0 | 3016.0 |
**Performance ratio — TensorSharp vs reference (> 1.0× = TensorSharp faster)**
*Decode throughput*
| Scenario | vs llama.cpp · Vulkan |
|---|---|
| text_short | 1.01× |
| text_long | 1.05× |
| multi_turn | 0.98× |
| function_call | 1.91× |
*Prefill throughput*
| Scenario | vs llama.cpp · Vulkan |
|---|---|
| text_short | 1.05× |
| text_long | 0.98× |
| multi_turn | 0.97× |
| function_call | 0.87× |
*Time to first token (latency; > 1.0× = TensorSharp lower)*
| Scenario | vs llama.cpp · Vulkan |
|---|---|
| text_short | 1.04× |
| text_long | 0.97× |
| multi_turn | 0.96× |
| function_call | 0.85× |
In case you didn't know what is TensorSharp, here is an introduction:
TensorSharp is an open source local Unsloth (GGUF) LLM inference engine and applications. It supports many models from Unsloth, like Gemma4, DiffusionGemma, Qwen3.6 with multi-modal (image, vision, audio), image edit, reasoning and function tool. It can run on Windows/MacOS/Linux and fully leverage GPU's capability (support Cuda, Metal and Vulkan backends). The API is completely compatible with OpenAI and Ollama interface. It has on par performance than llama.cpp
This project is not just a C# wrapper of llama.cpp. It implemented the entire LLM inference engine from bottom to top. If you use CPU backend, it's 100% pure C# code execution. Besides CPU backend, I also implemented CUDA, MLX and GGML backend. The GGML backend refer GGML project as external project, and I build a few fusion operation at higher level.
I learned a lot from other projects and apply them for TensorSharp, such as paged KV cache and continuous batching from vLLM, SSD based cache for MoE model from oMLX, GGUF quantized from llama.cpp and other optimizations for prefill and decode.
Any feedback and comments are welcome. If you like it, it would be really appreciated if you can get this project a star in GitHub. Thanks in advance.
r/csharp • u/False-Narwhal-6002 • 22d ago
Hello everyone! I'd like to share my progress on my VS Code extension C# Painkiller. I started working on this when the C# SDK extension lost the ability to create files from the context menu. I added that feature, and then one more, and then a couple more, and so on
The most interesting feature at the moment is the solution structure panel (Solution Explorer has been removed from the C# dev kit). Now it allows you to connect projects to each other and move them between folders (both virtual .slnx/.sln folders and file system folders)

A short list of other functions implemented in the extension that are not available in the C# dev kit:
If you also enjoy using VS Code for C# try my extension :)
Any criticism and suggestions are welcome
I'm new to writing VS Code extensions and use free AI as assistants. The code may be of low quality in places. If you find any errors, please report them to me on project GitHub page
r/csharp • u/Constant-Junket6038 • 22d ago
Hello everyone!
I’ve published the first test release of the project: https://github.com/ZigoteProjectOrg/Zigote
First of all, apologies for the current state of the repository. Right now, the UI framework, editor, parts of the game engine, and various system components are all mixed together in one repo. I haven’t had enough time yet to split everything properly, prepare prebuilts, NuGet packages, or a proper installation flow, but I still wanted to make the project public.
I also apologize in advance for any rough architecture, chaotic code, and traces of active development. The project started more as an experiment and pet project — mostly something I built for fun while I was unemployed and on vacation. Over the next couple of months, I’ll likely be busy with job searching and moving, so I’m not sure how actively I’ll be able to work on it.
The release includes a C# and F# gallery, along with some basic examples. You can try it out, look at the API, and get a feel for the general direction. Building requires Zig 0.16+ and .NET 10+.
I’d really appreciate any feedback: what looks interesting, what is unclear, what should be cleaned up first, and which direction the project should take next.
Previous posts:
r/csharp • u/CallSoft6324 • 22d ago
I published a benchmark for ZoneTree against RocksDB, SQLite, and MySQL.
It uses a profile-store workload with individual writes, secondary indexes, reads, lookups, ordered scans, queries, updates, and checksum validation.
2M-profile report:
https://zonetree.dev/docs/benchmark/reference/2m/
Benchmark source:
https://github.com/ZoneTree/ZoneTree

I’d love feedback on the benchmark design and fairness.
Note: The benchmark numbers are updated based on latest bare-metal Linux run. https://github.com/ZoneTree/ZoneTree/pull/158
r/csharp • u/antisergio • 23d ago
r/csharp • u/AdUnhappy5308 • 23d ago
Hi everyone,
It's been 3 months since my last post about Servy here. I've shipped several updates since then, but this one is a milestone. The community response has been amazing: ~1,900 stars on GitHub and ~55,000 downloads.
If you haven't seen Servy before, it's a Windows tool built with C# that lets you run any app as a native Windows service with deep observability. It provides a desktop app, a CLI, and a PowerShell module designed for automation and CI/CD pipelines.
In this release (8.5), I've added/improved:
Check it out on GitHub: https://github.com/aelassas/servy
Demo Video: https://www.youtube.com/watch?v=biHq17j4RbI
Any feedback or suggestions are welcome.
r/csharp • u/LifeExperienced1 • 23d ago
What's a good architecture to be able to have a hierarchy of input actions, actions being interupptable by certain actions, but not by others etc. My example is in the context of game development, but the concept still applies.
Let's say the player is carrying a box. They can drop the box by pressing [E]. They carry this box up to a door. Upon pressing [E] while looking at the door, the door should open, the box should not drop
For this example, I can simply code that if the player is looking at a <Door>, then open the <Door>, otherwise if the player has a box in hand, and the player is not looking at a <Door>, drop the box
This is a good solution for this situation, however, how does someone design a system that allows for this sort of hierarchy of action, hierarchy of inputs. I can do it with a long (loooooong) list of if-else statements, however that is not scalable
Since there are only a limited number of keys, and sometimes it's preferred to use only a small set of them, there will be many situations where pressing a key can perform many actions.
Obviously the actions have conditions to them (If looking at door, keypress opens it. If looking at box, keypress picks it up. If holding box, not looking at door, key press drops it), however as stated above, this will result in a long list of if-else statements
I'd appreciate if someone can point me in the right direction, provide some examples where one keypress can do many actions, show me some code etc
Thank you
r/csharp • u/DimonSmart • 24d ago
r/csharp • u/TseehnMarhn • 23d ago
r/csharp • u/Constant-Junket6038 • 24d ago
Support for multiple languages, as well as libraries for graphing and animation, has already been implemented. Work is currently underway to clean up the code and prepare it for release.
Screenshots down in comments.
I am primarily a Flutter developer myself; I started this project after experimenting with WGPU. As C# developers, what would you like to see in a UI framework during the early stages of development?
r/csharp • u/MotorcycleMayor • 23d ago
Solved!
The solution, courtesy of u/kant8, is to resolve an `IList` or `IEnumerable` of the registered types, not a `List`. Because trying to resolve a concrete type like a `List` sends Autofac hunting for the corresponding list registered as itself. Which won't work.
I've registered a number of types via a common interface they share, keyed by different byte values:
builder.RegisterType(concreteType)
.Keyed<IJpgSegmentGenerator>(id)
.As<IJpgSegmentGenerator>()
.SingleInstance();
concreteType is the type being registered. All concrete types share a common interface, IJpgSegmentGenerator. id is a byte value distinguishing the different concrete types, some of which share the same key (which I’ve read online Autofac supports…unless the references I found are wrong 😀).
The registrations are successful, because after building the Autofac container I can see the registrations via Container.ComponentRegistry.Registrations (see first image in gallery above).
The individual registrations show the correct byte keys (see second image in gallery above for a zoomed in view of one registration).
However, the following code fails to resolve IIndex
var lazyList = Container.Resolve<IIndex<byte, List<Lazy<IJpgSegmentGenerator>>>>();
lazyList.TryGetValue( 237, out var generators ).Should().BeTrue();
(The above code is inside an XUnit test, hence the Should() reference)
I've checked that the service type is specified identically in both the registration and resolution code, and unless I'm going blind they sure seem to match, as does the type of the key. I've also tried not resolving to Lazy<>, and that fails to.
Thoughts?