r/dotnet • • Apr 02 '26

Rule change feedback

18 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!


r/dotnet • • 7h ago

Aspire 17 is out

38 Upvotes

Yes they bumped a few major versions for whatever reason. Includes some breaking changes: https://aspire.dev/whats-new/aspire-17/#-upgrade-to-aspire-170

> Aspire 17.0 puts your resources at the center of a redesigned dashboard, with a resource table home page, a dedicated Terminals page, and graph export to Mermaid. Go AppHosts are in preview, a tray companion keeps running AppHosts within reach, and the Kubernetes deployment packages are stable. Many APIs that previously required an experimental-warning suppression are now stable, too.


r/dotnet • • 1d ago

Article .NET packages that introduced commercial licensing

Post image
444 Upvotes

I recently come accross Doctor milan jovanovic's article and started checking the packages used in my .net projects and found out the following nuget packages are starting introducing commercial licensing.

  • AutoMapper — v15
  • MediatR — v13
  • Fluent Assertions — v8
  • MassTransit — v9
  • EPPlus — v5
  • EFCore.BulkExtensions
  • Duende IdentityServer — successor to IdentityServer4
  • NServiceBus — v2.5
  • ServiceStack — v4 -
  • SixLabors.ImageSharp - v3
  • Polly
  • QuestPDF
  • iTextSharp

What do you think about this? any recommendation?


r/dotnet • • 2h ago

Aspire 17 is ready for primetime!

Thumbnail reddit.com
6 Upvotes

r/dotnet • • 8h ago

Question Best way to switch between local ProjectReference for debugging and NuGet PackageReference for Git?

8 Upvotes

My main project depends on two of my own packages hosted on NuGet. The projects for these packages are not included in the solution, and they are referenced via PackageReference in the .csproj file—which is how it's committed to Git.

Currently, to debug the main project alongside the latest local versions of these packages, I removed them from PackageReference, added their projects to the solution, and switched them to ProjectReference in the .csproj. However, this is strictly a debug configuration. Before pushing to Git, I need the version that uses PackageReference without the package projects included in the solution.

What is a convenient way to set this up so I don't have to manually modify the solution and .csproj files before debugging and then revert them every time?


r/dotnet • • 8h ago

New WPF theme Nocturne.WPF

7 Upvotes

Uuups i did it again ... I've created yet another WPF theme :D (with the help of Claude)

Acrylic, Accented, with lots of controls to choose from.

- Automatically disables transparancy when using the program via RDP for better performance.

- Can pickup system accent for personalized theming.

- Comes with virtualized datagrid, search combobox and more.

https://montago.github.io/NocturneTheme/

https://github.com/Montago/NocturneTheme

https://www.nuget.org/packages/Nocturne.Wpf/


r/dotnet • • 2h ago

Implicitly converting from double to decimal

Thumbnail reddit.com
1 Upvotes

r/dotnet • • 3h ago

We checked who reviewed 548k merged PRs in 393 popular repos. AI-signed PRs got commented on a little more than the rest, not less

Post image
0 Upvotes

We checked who reviewed each merged PR over 12 months in the 50 most-starred repos of nine languages, C# among them. Bots, tools' user accounts and the author's own replies don't count as review.

In the median repo owned by an organization, 26% of merged PRs were reviewed with comments by someone else, 35% were approved without a word, and 22% were merged with no other review. C# is right in the middle - in the 38 C# repos owned by an organization, 23% had no other review and 25% were reviewed with comments. Repos owned by one person are another world: 91% merged with no other review, which is why the chart splits them.

We also compared PRs written by AI agents (Copilot's coding agent, Claude Code and others) with the rest of the PRs in the same repo. In 102 of 160 repos, the AI PRs were more often reviewed with comments. So reviewers don't seem to wave AI PRs through. If anything, they look at them a bit more closely. (That finding was surprising as we expect the other way around!)

Method, whether silently approved PRs get fixed later, every repo and a CSV: https://coderot.ai/blog/pr-review-in-open-source?utm_source=reddit-dotnet-review

Disclosure: we build coderot, which measures this in CI.

Does your team require a human review on Copilot agent PRs, or do some go in on an approval alone?


r/dotnet • • 1d ago

After a long delay, StyleCop is under active development again

63 Upvotes

Hey gang,

Some good news for people who like the StyleCop approach to keeping their codebase in tip-top shape.... the project has been brought back to life with Microsoft's help** and they've finally released version 1.3, their first non-beta release of StyleCop since 2019. You know it's been a long time when the first feature mentioned is "Support for C#8 through 15" 😄

For those not familiar, StyleCop is a Roslyn analyzer that does file-level code analysis and reformatting. When .NET 5 introduced the "EnforceCodeStyleInBuild" property (and later allowed setting per-setting severity in .NET 9), that replaced a lot of StyleCop's core formatting functionality.

But neither editorconfig not the built-in formatter in .NET doesn't cover everything you might want from a formatter. Examples of other things StyleCop can do:

  • XMLDoc comment formatting
  • Class member ordering
  • Enforce "one-file-per-type" and "match-filename-to-typename"
  • Formatting of long parameter lists on functions (e.g. switch from one line for all parameters to one line per parameter based on the parameter list length)
  • Blank line rules (e.g. a blank line before a single-line comment, no duplicate blank lines)

StyleCop is configured via editorconfig these days so it's pretty straightforward to get going. Just watch out for conflicting rules (e.g. editorconfig rule says "use a _ prefix for private variables" and a StyleCop rule beside it says to remove them.)

I'm not associated with the project, but my teams used it a lot in the olden days and I'm very happy to see it return.

Release page on GitHub: Releases · DotNetAnalyzers/StyleCopAnalyzers

And yes, for the "AI code generation" crowd, formatting tools like this still offer a ton of value. Claude, e.g., tries to copy the code style of immediately-surrounding code when editing, but it isn't very good at understanding where to put new code. I've seen it put two similar public constructors more than 1,000 lines apart. 🙄 Adding rules to agents files that say "put private members after public members" or "sort members alphabetically" (or worse "follow editorconfig rules") sound good at first, but they can gobble up a a lot of tokens since the entire file needs to be read and parsed even if it's making a single-line change. Editing C# files through a Roslyn instance wrapped by MCP will take care of those changes cleanly without the LLM having to get involved. And it always works even when the LLM gets forgetful in a long session.

(** note that despite being worked on by Microsoft people, it's not an official Microsoft project. Also, Sam Harwell, who originally created StyleCop and worked on Roslyn for years, is no longer at Microsoft and isn't involved in this new release.)


r/dotnet • • 3h ago

I built MigrationSentinel — an open-source .NET CLI tool that catches breaking EF Core, SQL Server & PostgreSQL migrations before deployment

1 Upvotes

Hey r/dotnet,

I just released **v1.0.0** of **MigrationSentinel** (MIT license) — a .NET global tool and library that analyzes **Entity Framework Core C# migrations** and raw **SQL Server / PostgreSQL** scripts before they hit production.

Instead of brittle regexes, it uses:

- **Roslyn (`Microsoft.CodeAnalysis.CSharp`)** to parse `MigrationBuilder` calls — including recursively parsing raw SQL hidden inside `migrationBuilder.Sql(...)`

- A **dialect-aware SQL lexer & AST parser** supporting T-SQL and PostgreSQL (multi-clause `ALTER TABLE`, dollar-quoted strings, comments without false positives, `sp_rename`, etc.)

- **14 built-in DBA rules (`MS001`–`MS014`)** detecting destructive drops, narrowing column types, `NOT NULL` columns without defaults, blocking `CREATE INDEX` (missing `CONCURRENTLY` / `ONLINE = ON`), unfiltered `DELETE`/`UPDATE`, `ON DELETE CASCADE`, and empty `Down()` methods

- **Auto-generated safe rollout SQL** (Expand-and-Contract patterns tailored to SQL Server vs PostgreSQL)

- **Git diff PR gating** (`migration-sentinel diff --base origin/main --fail-on high`) + **SARIF 2.1.0** export for GitHub Code Scanning

- Optional AI review via OpenAI API or local **Ollama** (100% offline)

### Install & Try

```bash

dotnet tool install -g MigrationSentinel

migration-sentinel scan ./Migrations

```

- **GitHub:** https://github.com/Fatollahsalimi13/MigrationSentinel

- **NuGet:** https://www.nuget.org/packages/MigrationSentinel

Would love feedback from .NET backend devs and DBAs — especially on additional rules or MySQL/Oracle support you'd want to see next!


r/dotnet • • 6h ago

Question is C# a good language to use for making a game engine?

0 Upvotes

so I have a from what i find a intermediate amount of knowledge on C# and have made some games in unity. now i want start a big project that could really make me a better programmer and after some researching i would like to maybe start making my own game engine. would this be a good idea? or is there another big project that maybe could be better suited? i know it could take longer than a year to build and that i need to learn a lot about low level programing but i think it could be really fun. or should i do the project in C++?


r/dotnet • • 13h ago

Multi-tenant SaaS with EF Core global query filters — how do you protect against someone calling IgnoreQueryFilters()?

2 Upvotes

I’m using a TenantId column plus a global query filter to isolate tenants in a multi-tenant ASP.NET Core app on PostgreSQL. It works well, but one IgnoreQueryFilters() or a raw SQL query could leak data across tenants.

What do you do about this in production?

  • Architecture tests that ban IgnoreQueryFilters outside certain folders?
  • PostgreSQL Row-Level Security as a second layer?
  • Something else?

Curious how teams handle defense-in-depth here.


r/dotnet • • 53m ago

Question Upgraded to .NET 11 with an agent, what broke for you

0 Upvotes

We have a mid sized ASP.NET Core API, about 40 projects in the solution, and I let an agent do the .NET 10 to 11 upgrade on Tuesday mostly to see how it would go.

The good part: it bumped the target frameworks, updated around 30 packages, fixed the build errors and had a green PR in about 2 hours. That would have been at least 2 days for me.

The less good part:

- it swapped one obsolete serializer call for a newer one that handles nulls differently, and two of our API responses changed shape. Our mobile app noticed before we did
- it upgraded a package to a major version without mentioning the breaking change in the PR description
- one test project it "fixed" by removing an assertion that failed

coderabbit flagged an obsolete API it had kept in one place, which was nice, but nothing caught the serializer change because the diff looked perfectly reasonable. It was only obvious once you compared the actual JSON.

For people who already upgraded: what broke for you? And did anyone have a good experience letting an agent do the whole upgrade, or is it still a "do it yourself and let the agent fix the build" job?


r/dotnet • • 1d ago

Is there some way of finding out API mismatch and/or runtime errors for nuget packages that multi-target to .NET Standard 2.0 + net48/net10?

6 Upvotes

I am in the process of converting some multi-targetting libraries (net48/net10) to netstandard2.0 only as a means to have no surprises at runtime and guaranteed no mismatch of the API the library exposes.

The issue I anticipate is that a number of third-party nugets that say they target netstandard2.0 in addition to net48/net10 have inconsistent API surfaces / sometimes even throw from their netstandard2.0 code acting as quasi reference assemblies.

Is there some tooling out there (besides author's docs) that will help identify issues like that?


r/dotnet • • 18h ago

Question How to do auto source generation in unity?

1 Upvotes

Hi I'm trying to port some python libraries in .net using csnake but it requires source generation ..

Now unity support latets .net as experiment and to some extent source generators but I'm not sure exactly how to do that a PoC would be perfect for it .


r/dotnet • • 1d ago

What should i do about this ?

Post image
13 Upvotes

everytime when i try tpo run a .net project or a unity project i get a simmilar pop up and it wont run properly


r/dotnet • • 2d ago Mindblown

.NET 11 won't start on CPUs below x86-64-v2, and you won't get a compiler warning

175 Upvotes

Going through the .NET 11 upgrade notes this week, and two things changed how I'm planning it. Posting in case it saves someone a bad deploy.

  1. The minimum x64 baseline went from x86-64-v1 to x86-64-v2 (SSE4.2, POPCNT, CX16 and friends). Below that, the runtime refuses to start with "The current CPU is missing one or more of the baseline instruction sets." Any normal server from the last decade is fine. The ones I'd worry about are old build agents, cheap VPS hosts and emulated CI environments. Windows on Arm64 now needs LSE too.

On Linux you can check a box with:

/lib64/ld-linux-x86-64.so.2 --help | grep -A4 "Subdirectories"

If x86-64-v2 isn't listed as supported, .NET 11 won't run there.

2. "Just take the LTS" doesn't decide anything this year. .NET 10 is LTS with three years and .NET 11 is STS with two, but 10 is a year older, so both end support in November 2028. The real question is whether your providers have 11.x builds and whether you want C# 15 unions or EF Core 11, which needs .NET 11.

Also, .NET 8 and 9 both went out of support on 10 November, same day 11 shipped.

Has anyone already hit the CPU check in CI or on older hosts? And for those who've moved: did you go to 10 or 11?


r/dotnet • • 1d ago

Copilot CLI sanboxed issues

3 Upvotes

Hi!

We are experiencing issues when running copilot cli in sandbox mode. dotnet build fails when not running with -m:1 and -nr:false. It just fails with "Build Failed" warnings 0, errors 0. Are we missing something in our sandbox configuration. Have someone else experienced this?

Also, there seems to be some implicit git task in the dotnet build pipeline that runs for git SourceLinks that tries to read C:/Users/<user>/.gitignore. since we havent allowed C:/Users/<user> as a readable path it fails.

Fixing these two things makes copilot able to build.


r/dotnet • • 1d ago

Best approach for centralized DateTime handling in ASP.NET MVC 5?

Thumbnail reddit.com
1 Upvotes

r/dotnet • • 1d ago

Suggestions on azure table storage delete design

4 Upvotes

Have a table storage that stores user data andhas to be cleared out after 29 days due to compliance.

The data is written by a microservice hosted in kubernetes in an event driven architecture. Now I am thinking of writing a background service that will read data in batches of 500 and delete them every 5 minutes in order to not overwhelm the azure table storage and also keep the service memory and CPU utilization in check as it already handles a lot of events and api requests. Looking for suggestions if this is a good approach and what enhancements can be made to it.


r/dotnet • • 2d ago

Question Coding agent bloat

42 Upvotes

I've been using Cluade code both at work and for personal projects.

Observations

  1. Too many XML comments.
  2. Too many non sensical tests. Example, testing the `typeof` of an object within unit test assertions seems non sensical in these specific cases.
  3. Too many ADRs

Agents write relatively more code than what I can process. I need time to review.

My attempts

  1. Stricter rules in Agents.md
  2. Skills
  3. Stricter prompts.

These do work for coding patterns, because I can describe specifics, but never for comment length or verbosity.

I'm tired of asking Claude everything, so I thought I'd solicit some suggestions / help from people here.

TIA


r/dotnet • • 1d ago

How are you handling countries, currencies, and cities data in your apps?

Thumbnail reddit.com
2 Upvotes

r/dotnet • • 2d ago

Best .net educator

59 Upvotes

Hi guys, i know many .net educators like Milan jovanivic, nick champas, patrick god, neil cummings, tim corey and so on..
But i never followed none of them, so i am here to ask, which one content could you highly recommend?
Thanks!


r/dotnet • • 2d ago

Artifact Signing (Trusted Signing) SmartScreen warnings came back in late October: timeline and what Microsoft has said

11 Upvotes

In late October, installers signed with Artifact Signing started showing "Windows protected your PC" again. The signatures were valid. Nothing changed on the developer's side. Two people in the GitHub issue said the GitHub Desktop installer warned too.

If you sign with it, here is what I could piece together.

Timeline

- Mar 26. New intermediate CAs go live: AOC CA 03, EOC CA 03, EOC CA 04. Builds signed through them start to warn.

- Jun 18. Microsoft staff on Q&A: "Reputation propagation for the new intermediate CAs has been corrected." (thread (https://learn.microsoft.com/en-us/answers/questions/5855708/trusted-signing-regression-in-smartscreen-reputati))

- Oct 21–28. It comes back. New builds on all three CAs warn again.

- Oct 29. A Microsoft engineer in #128 (https://github.com/Azure/artifact-signing-action/issues/128): "reputation should be propagating as expected now". The caveat: "identities must have positive reputation to not show the warnings by default".

- Nov 4. A customer quotes their support case: "A bug was identified that can cause additional SmartScreen errors". The fix "is still being worked on". The workaround is to submit each release to Microsoft.

The issue is open since April and has over 240 comments.

What I measured

I run installers on a clean Windows 11 VM. The file is downloaded with the Mark of the Web, like a browser does, and I record whether SmartScreen shows up.

Between Nov 1 and Nov 14 I ran nine installers signed through the new CAs. That includes Git, Python, Zed, draw.io, LocalSend and ShareX. All four new CAs are covered.

None of them warned. ShareX was 26 hours old.

What that does not show

- Nothing ran inside the bad week. Four files were signed in it, but I ran them on Nov 1.

- These publishers have years of history. A popular file can clear on downloads alone.

- No new publisher is in the set. That is the case people still report as broken.

- One machine, one run per file.

So: for publishers with history, the new CAs look fine in November. For a new identity, I have no data.

If your build warns

  1. Check the timestamp first: signtool verify /pa /v installer.exe. The certificates live 72 hours. Without a timestamp, Windows treats the file as unsigned once it expires.
  2. Is your identity new? Then it may be plain reputation, not the bug. If older builds were clean and a new one warns, it points at the bug.
  3. Submit the file at microsoft.com/wdsi/filesubmission ("Incorrectly detected as malware/malicious").
  4. Post in #128 with the CA and the signing date.
  5. Don't re-sign in a loop. Each re-sign is a new hash with no history.

Question: if your identity was validated in the last three months, does your installer warn today?

Disclosure: I run SignalScreen, which ran these probes. Full table with links to each result: https://signalscreen.dev/blog/artifact-signing-smartscreen-warning?utm_source=reddit&utm_medium=post&utm_campaign=ats-blog