r/dotnet • • Apr 02 '26

Rule change feedback

16 Upvotes

Hi there /r/dotnet,

A couple of weeks ago, we made a change to how and when self-promotion posts are allowed on the sub.

Firstly, for everyone obeying the new rule - thanks!

Secondly, we're keen to hear how you're finding it - is it working, does it need to change, any other feeback, good or bad?

Thirdly, we're looking to alter the rule to allow the posts over the whole weekend (sorry, still NZT time). How do you all feel about that? Does the weekend work? Should it be over 2 days during the week?

We're keen to make sure we do what the community is after so feeback and suggestions are welcome!

621 votes, Apr 07 '26
77 I love the change
79 I like the change
57 I don't care
28 I dislike the change
16 I loathe the change
364 There was a change?

r/dotnet • • 5h ago

Article I built a .NET LLM inference engine that runs an 816B MoE model across 10 GPUs — here’s what I learned about C# and native performance

Thumbnail github.com
86 Upvotes

I’ve been developing TensorSharp, an open-source LLM inference engine and agent runtime built with C#/.NET.

One question I’ve been exploring is:

Can .NET serve as the foundation for a high-performance LLM inference engine, rather than just being a wrapper around Python-based inference servers?

Recently, I got Muse Spark 816B (42B active parameters) running across 10 NVIDIA A40 GPUs and benchmarked TensorSharp against llama.cpp.

I wanted to share some results and engineering lessons, particularly around managed/native execution, multi-GPU scheduling, and where C# fits into performance-critical AI infrastructure.

The architecture

TensorSharp uses C#/.NET for the inference engine’s orchestration, model execution management, request scheduling, KV cache management, and agent runtime.

GPU computation is handled through native backends, including CUDA, Metal, and Vulkan.

The idea isn’t to reimplement CUDA kernels in C#. Instead, it’s to use .NET for the higher-level systems engineering while keeping computationally intensive operations in optimized native code.

This separation has some interesting benefits:

  • A unified runtime for model inference and agent execution.
  • Cross-platform support through different GPU backends.
  • Integration with existing .NET applications without requiring a separate Python inference service.
  • The ability to implement scheduling, caching, concurrency, and agent workflows in C#.

But it also raises an important performance question: where should the boundary between managed and native execution be?

The experiment: 816B parameters on 10 GPUs

Test configuration:

  • Model: Muse-Spark-Open-816B-A42B
  • Quantization: Unsloth UD-IQ3_XXS (~316 GiB of weights)
  • Hardware: 10× NVIDIA A40 (46 GB each)
  • Context: 32K tokens
  • KV cache: F16
  • All model experts resident in GPU memory

I tested two multi-GPU execution strategies:

Layer splitting: Different GPUs own different layers.

Tensor parallelism: Each layer is distributed across multiple GPUs, requiring synchronization and communication.

Both were compared against llama.cpp on the same machine using the same model and requests.

Results

Benchmark TensorSharp llama.cpp
Layer split: single-request decode 16.69 tok/s 16.79 tok/s
Layer split: 4K prefill 999.7 tok/s 483.2 tok/s
Layer split: 16K prefill 1,346.8 tok/s 826.1 tok/s
Tensor parallel: decode 22.63 tok/s 16.19 tok/s
Tensor parallel: 4 concurrent requests 45.73 tok/s 24.49 tok/s

The most interesting result to me isn’t necessarily the comparison against llama.cpp.

It’s how much performance changed after moving the right parts of execution across the managed/native boundary.

Lesson 1: Native execution granularity matters enormously

TensorSharp previously had a managed tensor-parallel execution path that dispatched operations individually.

It worked, but performance was poor.

On this model, it achieved only 1.9–2.4 tokens/sec.

After switching to a native whole-model execution path using upstream ggml’s meta backend, TensorSharp reached 22.6 tokens/sec.

That’s roughly a 10× improvement over our previous implementation.

The lesson wasn’t that C# is inherently slow.

It was that executing too many fine-grained GPU operations across a managed/native boundary introduces unnecessary overhead.

Keeping the higher-level scheduling and orchestration in .NET while moving the performance-critical execution graph into native code made a huge difference.

Lesson 2: GPU scheduling can matter more than raw compute

For layer-split inference, we implemented pipelined prefill.

Instead of processing the entire prompt sequentially through GPU 0, GPU 1, GPU 2, etc., the prompt is divided into micro-batches.

While GPU 1 processes micro-batch A, GPU 0 can already start processing micro-batch B.

We also implemented adaptive micro-batch sizing and larger prefill steps for single-request workloads.

With these changes, TensorSharp reached approximately 1,347 prefill tokens/sec on a 16K-token prompt.

That’s 1.63× the llama.cpp result on the same hardware.

This is a good example of why inference performance isn’t just about writing faster kernels. The execution and scheduling strategy matters enormously.

Lesson 3: More parallelism isn’t always faster

Tensor parallelism improved generation throughput, but it was significantly slower than layer splitting for long-prompt prefill.

In TensorSharp:

  • Layer-split prefill: ~1,347 tok/s
  • Tensor-parallel prefill: ~295 tok/s
  • Layer-split decode: ~16.7 tok/s
  • Tensor-parallel decode: ~22.6 tok/s

The reason is communication overhead.

Muse Spark’s MoE architecture requires substantial cross-GPU reductions, and this particular machine had broken GPU peer-to-peer transfers.

NCCL therefore had to communicate through host memory.

This made the optimal execution strategy workload-dependent.

It’s also an interesting problem for a .NET scheduler: selecting execution strategies based on model architecture, hardware topology, and request characteristics.

Lesson 4: Performance optimizations need correctness validation

We also compared next-token probability distributions against llama.cpp on 12,276 positions from WikiText-2.

TensorSharp achieved:

  • 98.84% top-1 agreement in layer-split mode.
  • 98.82% top-1 agreement in tensor-parallel mode.
  • Perplexity of approximately 1.848, compared with llama.cpp’s 1.847.

We additionally ran integration checks covering JSON generation, tool calling, multi-turn conversations, cache reuse, and concurrent requests.

TensorSharp passed 13/14 checks with layer splitting and 14/14 with tensor parallelism.

These aren’t comprehensive model-quality evaluations, but they help catch regressions while optimizing the execution engine.

A note about the comparison

There are some important limitations.

llama.cpp’s NCCL-enabled build failed on this particular 10-GPU setup due to CUDA peer-access restrictions, so its tensor-parallel results used the non-NCCL implementation.

TensorSharp includes a workaround that allowed NCCL to run over shared memory.

Therefore, the tensor-parallel performance gap should not be interpreted as a general advantage over llama.cpp on all hardware.

The layer-split comparison is more directly comparable, and single-request decode performance was essentially identical.

All measurements were taken on one machine with one model. I’d like to test more hardware configurations, especially systems with working P2P or NVLink.

Why I’m sharing this here

A lot of LLM infrastructure is built around Python, C++, and CUDA.

I think there’s an interesting opportunity for .NET to participate more directly in this space, especially for developers who want to build AI-powered applications without maintaining a separate Python-based inference stack.

TensorSharp is my attempt to explore that direction.

It’s open source, and the full benchmark report includes the methodology, configuration, limitations, and reproduction scripts.

GitHub: https://github.com/zhongkaifu/TensorSharp

Full benchmark: https://github.com/zhongkaifu/TensorSharp/blob/main/docs/perf/muse-spark-vs-llama-cpp.md

I’m particularly interested in hearing from other .NET developers:

Have you worked on performance-critical systems that combine C# with native C++/CUDA libraries? Where have you found the managed/native boundary works best?

And more broadly, do you think .NET has a larger role to play in local AI inference infrastructure, or is it better suited to application-level orchestration?


r/dotnet • • 3h ago

Do you stick strictly to LTS releases in production, or do you deploy STS (Standard Term Support) releases as well?

5 Upvotes

Do you stick only to LTS .NET versions in production?

Running a poll on this currently. I knew many .NET devs liked to stick to LTS versions only, but wasn't expecting it to be so high, although this is likely to not be representative, I'm not sure.

Microsoft have confirmed there is no difference in quality between STS and LTS releases, and not too long ago STS releases moved from 18 to 24 months support.

So why in your opinion is there still so strong preference for STS? Is some of this coming from other platforms where STS releases might indeed be 'experimental'?

I didn't want to create a poll here too to preserve the numbers so please consider voting in the poll if you like and can, thank you -> https://www.linkedin.com/posts/davidcallan_net-developers-do-you-stick-strictly-to-activity-7517560007018823681-ZHsd


r/dotnet • • 1d ago

The death of Open Source in the NuGet eco-system

172 Upvotes

One by one, most of the major open source packages in NuGet are going the paid commercial license route. Its becoming harder and harder to write .NET software in a work setting as most of the crucial NuGet packages we used to depend on are becoming paid software. With the proliferation as part of our daily driver tool kit, justifying commercial license for NuGet packages to stakeholders is harder than it's ever been as they often think AI can write a free alternative (which, I mean, they're not completely wrong). I'm absolutely frustrated by the continuous bait and switch licensing that's been happening in the eco-system as well. Some developers have done a much better job than others in communicating and preparing for licensing changes, however some have absolutely trojan horsed us into some pretty difficult positions. I also resent the fact that .NET and NuGet don't give you better tools to manage, control, and protect yourself from installing packages with paid or specific licensing requirements.


r/dotnet • • 3h ago

Implement Unit tests with sitecore CMS 10.4 XM/XP in project

1 Upvotes

I work with sitecore CMS 10.4 XM/XP and this is the first time we are trying to implement unit testing by writing testcases for the sitecore project that I am working with. We are planning to think of writing a use case for Google bots which crawl into our website and trying to automate a test that could allow the bots only in production to crawl. If anyone, who already implememted this usecase or maybe provide an idea or enlighten on this. All the responses are much apreciated


r/dotnet • • 7h ago

[Open Source] Created a simple tool to fix broken Windows Update policies and reliably install .NET Framework 3.5 (dev on .NET 4.7.2)

1 Upvotes

hi everyone,

we've all been there: trying to install dotnet Framework 3.5 on Windows 10/11 using DISM or optionalfeatures.exe, only to get slammed with err 0x800F0906, 0x800F081F, or 0x800F0954. this usually happens due to misconfigured wsus policies, blocked win update servers in corporate environments, or broken component store health.

to automate the annoying troubleshooting steps, i built a simple c# utility called net fx.

what it does (in click):

  • temporarily bypasses blocking registry keys (UseWUServer, RepairContentServerSource) to route through official MS servers.
  • resets Windows Update services and performs a deep DISM cleanup (/RestoreHealth & /StartComponentCleanup).
  • sttempts online integration.
  • offline fallback: if the online method fails, it automatically scans all connected drives (usb, mounted ISOs) for a local sources\sxs folder and force installs the package from there.

the project is fully open source, so feel free toaudit the code or build it urself. hopefully, this saves you some valuable time.

repo: NetFx


r/dotnet • • 1d ago

An introduction to Compact Binary Object Representation (CBOR) in .NET

Thumbnail andrewlock.net
102 Upvotes

r/dotnet • • 6h ago

Question .Net files missing and unsure how to proceed anymore

Thumbnail gallery
0 Upvotes

Sorry for the terrible pics, but I’m kind of panicking. Over the past two months I noticed my CCleaner wasn’t able to update these files (first four pics). I was confused, but figured that maybe they were updating manually instead and maybe that’s why they were erroring out every time I tried to update them through the app. Today, upon wanting to manually update my intel drivers for the new Cyberpunk patch, I found out that I was being hopelessly optimistic with that filed away explanation. I keep getting this error when trying to download the latest .Net (last picture), and all the online fixes I’ve found have done nothing to help me. I tried this fix and got stuck because the file he tells me to open (dark.exe) refuses to even run on my computer: WIX Toolset Fix
I won’t lie, I am not super computer savvy and I am starting to panic because I feel like I am far out of my element in trying to fix this. Please help me. I want to fix whatever issue I caused and be able to properly update my drivers.


r/dotnet • • 1d ago

C# once again the fastest web framework

Post image
65 Upvotes

r/dotnet • • 1d ago

What’s new in C# 15: Overview

Thumbnail medium.com
61 Upvotes

r/dotnet • • 9h ago

After a year of AI, why doesn't .NET development feel that different?

0 Upvotes

With AI moving so fast, I sometimes wonder why .NET libraries and framework releases still feel mostly incremental.

.NET 11 brings improvements, but are we seeing enough innovation in the ecosystem, or are we mostly refining what already exists?

What do you think? Which .NET libraries or features would you like to see evolve more significantly?


r/dotnet • • 1d ago

Question NET MVC multilingual website: JSON vs RESX vs separate Razor views

9 Upvotes

Hey everyone,

I'm working on an existing asp.net mvc 5 app targeting .net framework 4.8, and now we're planning to add multilingual support

Currently, we have two website for the same product.

example.eu - the main english website, where most of the functionalities(if not all) live.

example.bg - the bulgarian website, mostly static that redirects users to the main site for actual functionalities.

Our goal is to find a way to make the experience of adding/supporting multiple langauges on the main site, starting with english and bulgarian, potentially later add german, romanian and others easy.

I have looked at few approaches but each has some drawbacks, that's why I am looking for more opinions.

First - JSON translation files(en.json, bg.json and so on)

The idea is to have the translation ekys and load the appropriate dictionary based on language ie example.eu/bg will load bg.json.

The main concern in the developer experience and later on editing of text. When working on a Razer view and thee a placeholder for text, I want to be able to quickly find the corresponing translation, ideally i.e I could press F12 in VS and navigate to that key, but I don't think that's possible.

Second - RESX

That seems to be the traditional .NET approach, and VS does provide some tooling for it however, I have used RESX before and personally found editing and maintaining them rather frustrating.

Third - Separate view for each langauge

For example:
Home/Index.en.cshtml
Home/Index.bg.cshtml
Home/Index.de.cshtml

This would make the translating complete pages straightforward, especially for marketing content. However, it would also mean maintaining multiple copies of the same view. Every layout, markup or functionality change would need to be repeated across all languages, making it easy to miss something.

I am not sure what is the cleanest implementation. Maybe there is a FOURTH option, or a combination of all(or two of them above)

So questions are below:

- What would you choose?

- Would you use RESX, JSON files, JSON(In db? but it could slow down the page loads), separate pages, a combinations or other?

- Is there a way to get that IDE navigation for the json translation option

I am especially interested in solutions that are maintainable long-term, dev-friendly and easy to extend.

I appreciate hearing from you who have implemented a real production app :)

Thanks


r/dotnet • • 12h ago

Is C# worth learning in the AI era? (Web dev background looking to future-proof)

Thumbnail
0 Upvotes

r/dotnet • • 17h ago

Passenger IDE

Thumbnail passenger-ide.net
0 Upvotes

r/dotnet • • 1d ago

Ambiguous Reference "Errors"

Thumbnail
1 Upvotes

r/dotnet • • 1d ago

Question Is it justified to create an interface in this specific case ?

Thumbnail
0 Upvotes

r/dotnet • • 1d ago

Question API hosting help please!

0 Upvotes

Hi everyone, I'm in a bit of a bind. A colleague and I have been developing a project centered around a .NET 10 API. We're nearing completion, and I was preparing all the environments for deployment.

I had originally planned to host the API on an Azure B1 instance to start with, but when I went to set it up, it wouldn’t let me. My quota is maxed out, and support hasn’t been much help so far.

I’m going to wait a few more days, but if that doesn’t work out, I’d like to know what you recommend for hosting the API. Just the API; I have the database and image storage on Supabase and the front end on Cloudflare.

I’m a software developer and I’m not particularly comfortable with infrastructure. My plan was to go with Azure since I’m familiar with it, but now I’m torn between the alternatives. I’ve been looking into Railway, Koyeb, Render, etc., but I’ve seen mixed reviews for many of them.

Another option I’ve come across is renting a server from Hetzner and using Coolify, but that would require me to manage the server myself firewall settings and all and that’s a bit daunting.

Oh, by the way, we’re on a relatively tight budget and this is for a first version, and if it doesn’t go much over €20, that’d be great. And it would be ideal if it were hosted in the EU.

Sorry for the long post, any help would be greatly appreciated.

Thanks!


r/dotnet • • 1d ago

Question smart app control, is out of hand?

0 Upvotes

is this just me? recent changes to Smart app control?

I don't know if Microsoft recently changed something but doing agentic development on a pure .net solution where I have a slew of separate probes that are just validating my core application, they all get blocked, everyday it's a new one getting blocked, I'm getting around it somewhat by moving the probe to WSL, but why don't they have a white list or an ability to let developers temporarily disable this. and what's worse if you disable it entirely you basically can't re-enable it without some registry hack and crossing your fingers. as re-enabling it really isn't supported..

it's so bad that I'm considering just setting up a dedicated development VM in hyper-v Windows image where I can have all the controls turned off. or just pure Linux in hyper v

Am I the only one getting this? any other solutions? I do like it being on for normal operation..

Update, I think I found why, this coincides with the exact timing it started:

Processing img j2ju1z1leuwh1...


r/dotnet • • 1d ago

Browser Link Hot Reload fails with custom local domain

2 Upvotes

Since the September .NET SDK update, Browser Link no longer works for Hot Reload in Visual Studio 2026 Enterprise.

The injected Browser Link script returns a 403 error. The browser console indicates a cross-origin issue because Browser Link tries to connect to localhost:PORT while my application uses a custom local domain (myapplication.localhost). I have specific reasons for using this domain.

Hot Reload itself still works, but the browser no longer refreshes automatically after changes because Browser Link fails.

I found this article, which describes a similar issue and suggests setting DOTNET_WATCH_AUTO_RELOAD_WS_ORIGINS. However, that solution applies to dotnet watch. I use IIS Express for debugging, and the environment variable does not solve the problem.

Is there a way to configure Browser Link to work with a custom local domain when debugging with IIS Express?


r/dotnet • • 2d ago

PDFSharp went dual license. AGPL or commercial license

105 Upvotes

r/dotnet • • 1d ago

Is dotnet with mvc architecture worth in 2026 in India?

0 Upvotes

I am a fresher and recently joined a company and they use dotnet with mvc architecture so I am worried that I won’t be able to switch into a job with dotnet and angular or there isn’t growth in dotnet also if you’ve read this far tell me should I use blazor components?


r/dotnet • • 2d ago

How are you authenticating your agents' tool calls?

0 Upvotes

India's CERT-In put out a critical advisory last week (CIAD-2026-0049). Agents being evaluated by AI providers got into live systems at real companies using keys from config files, public repos and over-scoped cloud roles. None of the companies spotted it; they found out when the providers disclosed it.

It made me look at how agent code usually calls tools. The usual pattern is forwarding the signed-in user's access token to every tool. That works, but the API then can't tell a user from an agent, and the audit log blames the user for whatever the agent decides to do.

The alternative I'm leaning towards is a separate client per agent with narrow scopes and a short token lifetime, plus an authorization policy that rejects agent tokens on things like refunds and admin routes.

Is anyone doing token exchange (RFC 8693) in production for this, or is a separate client-credentials client the practical answer? Curious what's actually working in your setups.


r/dotnet • • 3d ago

Article Build Locally, Ship to Cloud: Azure SQL Database container (Preview)

Thumbnail devblogs.microsoft.com
32 Upvotes

I see occasional discussions around needing container support for Azure SQL Database and I'm happy to share that it is now currently in preview, if you're interested you can fill out the form @ https://aka.ms/azuresqldb-container-signup and u/vandana-mahtani-msft will get you onboarded.

Has really helped out a ton on several projects that I've been working on lately.

Of note, Microsoft Employee and active moderator of r/SQLServer and r/MSSQL (and a few other subs). Mods feel free to remove the post if needed, I sent a mail but had not heard back.


r/dotnet • • 2d ago

Question .NET Agent Framework feature request

0 Upvotes

When making AI agents what are things you wish the agent framework had to make ai harnesses easier and other features you feel they overlook?


r/dotnet • • 2d ago

WPF JetPack Theme (kind of like MahApps Metro)

2 Upvotes

I'm working on a packaged version of the good old 2010 Silverlight theme "JetPack".

I had Claude have a good look at how MahApps Metro is structured and had it construct a JetPack theme bundle along with documentation for it.

The old theme doesnt have any licensing, other than its publicly available from Microsoft. Claude has re-implemented everything from scratch, so it should be ok to simply release it under MIT license ? (im no expert) ... two file was copied from the Silverlight theme.

MahApps Metro is more or less a copy of the Cosmopolitan Silverlight theme as well 🤷‍♂️

Anyways - feedback is appreciated :)

Repo : https://github.com/Montago/JetPackTheme

Documentation : https://montago.github.io/JetPackTheme/