r/dotnet • • 2m ago

Question Guidance architecture api + processing logic after

1 Upvotes

I have an endpoint where you upload files to and it stores them in blob storage and also created a new db entry with the file storage location and some other info. Now after that I need to do bunch of logic i dont think id want in the endpoint, such as looking at the file content, based on that do certain logic like creating new files, creating new db entries and finally publishing a message to an external rabbitmq queue.

I need something that triggers that “event” after my endpoint is called and then processes all that. What would you recommend for my use case?


r/dotnet • • 1h ago

Newbie How to publish my .NET app on my home server (CI/CD) ?

5 Upvotes

Hello,

The title is really more of an oversimplification.

I'd like to have some kind of CI/CD for my self made apps.

Code of the .NET app is on Github, and I thought I could use their build pipelines.

What I'd like to do is when pushing onto master, the app builds then publish itself on my server (as a Docker container)

I've got the app ready, my home server has already a few container running, but I've got no idea how to do that.

I've searched for a few tutorials online but none of them really do what I'd like to do, or they use paid services (like Azure) and I intend to replicate this kind of workflow for many other apps in the future. So I'd like to keep it free !

If you know a tutorial or two for a beginner on CI/CD that does exactly that, please enlight & share it with me !

And of course I don't want to use ChatGPT. I'm here to learn.

Thanks !


r/dotnet • • 2h 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 • • 4h ago

Aspire 17 is ready for primetime!

Thumbnail reddit.com
8 Upvotes

r/dotnet • • 4h ago

Implicitly converting from double to decimal

Thumbnail reddit.com
1 Upvotes

r/dotnet • • 8h 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 • • 9h ago

Aspire 17 is out

43 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 • • 10h ago

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

10 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 • • 14h 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 • • 20h 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

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

Thumbnail reddit.com
1 Upvotes

r/dotnet • • 1d ago

Article .NET packages that introduced commercial licensing

Post image
451 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 • • 1d ago

After a long delay, StyleCop is under active development again

64 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 • • 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 • • 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

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 • • 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 • • 1d ago

Question Will the rise of AI Coding affect the speed of new language features?

0 Upvotes

Recent comments on the .NET 11 and C# 15 release made me thinking this. With more and more code being written by AIs, will this have an effect of the development speed of the language itself?

Let's be honest, most of the new features being added are purely target at humans who read and write the code. To be more efficient, have cleaner structure and better understanding of what's happening.

In the age of AI, this is not a so important factor anymore. AI can read and write code, even with languages which are less readable, much faster than any human can do. So the AI is not dependent on such features.

In my research, there are already programming languages in the making, which are targeting AIs and not humans. Somewhere in the future the AI could skip the need for a higher programming language completely and could create assembler directly.

AI writing code like a human is only a temporary result of a bigger transition.

I hope this question is not to general, as it effects basically all frameworks and languages out there. But the comments on the recent .NET release made me really curious and thinking...


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 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 • • 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 • • 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


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!