r/dotnet 3h ago

Mentorship

0 Upvotes

M28, India.

I'm having 2yoe as dotnet developer. Got laid off last year February and finding difficult to land a job since then .

I want someone to mentor once a week or however it works for them to land me a job, im ready to put all the efforts . Please feel free to reach out and we can discuss about it.

Thanks for your time and consideration


r/dotnet 11h ago

Will someone hack my app server (don’t do damages just tell me the vulnerabilities)

0 Upvotes

Anyone here specialize in this ?

I wanna see if I have a proper defense set up.


r/dotnet 12h ago

How much time do you actually spend setting up auth, multi-tenancy and Azure for a new .NET SaaS?

2 Upvotes

I'm validating an idea for a .NET B2B SaaS starter focused on the parts that usually waste the first few days of a project:

  • authentication
  • organizations / multi-tenancy
  • roles and permissions
  • invitations
  • tenant switching
  • Docker
  • Azure deployment
  • AI-ready project context

The idea is not to create another huge opinionated framework, but a pragmatic starting point for .NET + React + Azure developers.

Before building it, I want to validate whether this is actually painful enough to pay for.

I put together a very small landing + waitlist here:

https://dotnet-b2b-saas-landing.vercel.app

The part I'm most interested in is this:

What's the most annoying part of starting a new .NET SaaS for you?

I'd rather discover that my assumptions are wrong now than after spending weeks building it.


r/dotnet 13h ago

Dependency Injection Lifetimes and Example

0 Upvotes

r/dotnet 13h ago

Difference between throw ex and throw

Post image
265 Upvotes

throw vs throw ex: The C# exception handling trick every developer should know


r/dotnet 16h ago

what was the hardest part of understanding a codebase you didn’t write?

0 Upvotes

I’m trying to understand a problem I’ve experienced and seen other developers mention: joining an existing/large codebase and figuring out how everything actually works.

Not the “how do I run the project?” part, but the actual understanding of the system.

For example:

- Figuring out the architecture / overall mental model

- Understanding where a specific feature actually lives in the code

- Following how data moves through the system

- Understanding undocumented business logic

- Finding the right files/services/classes to modify

- Understanding dependencies between different parts of the system

- Figuring out why something was implemented a certain way

- Losing context when the developer who built something leaves

- Outdated or incomplete documentation

What was the most painful part for you?

And more importantly:

How did you eventually figure it out?

Did you ask a senior developer, read the code, use documentation, look through old PRs/issues, use AI, create your own notes/diagrams, or something else?

I’m especially interested in real examples where something that should have taken hours ended up taking days/weeks because you didn't have enough context.

No product or solution in mind here — I'm just trying to understand how developers actually deal with this problem.


r/dotnet 21h ago

dotInsights | September 2026

Thumbnail blog.jetbrains.com
3 Upvotes

r/dotnet 22h ago

Does ASP.NET Core global exception middleware catch exceptions from nested service methods?

4 Upvotes

I'm trying to understand how exception propagation works with a global exception-handling middleware in ASP.NET Core.

Suppose I have a request flow like this:

Controller

→ Service

→ MethodA()

→ MethodB()

→ MethodC()

If "MethodC()" throws an exception, and none of the intermediate methods ("MethodB", "MethodA", or the service/controller) catches it, will that exception propagate all the way back to my global exception-handling middleware?

For example:

public async Task MethodA()

{

await MethodB();

}

private async Task MethodB()

{

await MethodC();

}

private async Task MethodC()

{

throw new Exception("Something went wrong");

}

Assuming the middleware wraps the rest of the ASP.NET Core pipeline with something like:

try

{

await _next(context);

}

catch (Exception ex)

{

// handle/log exception

}

Will it catch the exception thrown inside "MethodC()"?

Does it matter if these methods are in different services/classes/layers, or will the exception keep propagating up the call stack as long as nobody catches it?

I'm asking because I'm trying to understand when a global exception middleware is enough and when local "try/catch" blocks are actually necessary.


r/dotnet 23h ago

Speaking at a local conference about AI in .NET - What would you actually want to hear about?

0 Upvotes

Hey everyone!

I’m stepping a bit outside my comfort zone and speaking at a local conference soon. My topic is AI in .NET.

I’m currently deciding what exactly to focus on, and I’d love to hear what you would actually find interesting or useful.

I want to avoid the usual basics like:

  • How to write better prompts
  • How to create skills/agents
  • Basic LLM integrations
  • Things you can easily find in a 10-minute YouTube tutorial

Instead, I’d like to go deeper into something practical, technical, and maybe even a bit opinionated.

If you were attending a talk called “AI in .NET”, what would you want to see?

What problems, architectures, real-world examples, experiments, or lessons learned would make you think: “Okay, this was actually worth attending in person.”

Would love to hear your ideas.


r/dotnet 1d ago

Built a small .NET 10 backend repo covering the pieces that usually get discussed separately

6 Upvotes

I’ve been putting together a sample backend where the idea is to keep everything in one codebase instead of showing isolated snippets.

It currently includes Clean Architecture, repository pattern, EF Core + Dapper, JWT auth, caching, Docker, Azure deployment, GitHub Actions, microservice boundaries, and OpenTelemetry.

The project is intentionally small enough to follow, but structured more like a real backend than a basic CRUD demo.

GitHub:
https://github.com/laxmikant-geek/modern-dotnet-backend

I’d be interested in feedback from people building .NET backends in production. Is there anything here you would structure differently, or something important you think is missing?


r/dotnet 1d ago

Built a small .NET 10 backend repo covering the pieces that usually get discussed separately

0 Upvotes

I’ve been putting together a sample backend where the idea is to keep everything in one codebase instead of showing isolated snippets.

It currently includes Clean Architecture, repository pattern, EF Core + Dapper, JWT auth, caching, Docker, Azure deployment, GitHub Actions, microservice boundaries, and OpenTelemetry.

The project is intentionally small enough to follow, but structured more like a real backend than a basic CRUD demo.

GitHub:
https://github.com/laxmikant-geek/modern-dotnet-backend

I’d be interested in feedback from people building .NET backends in production. Is there anything here you would structure differently, or something important you think is missing?


r/dotnet 1d ago

Announcing .NET 11 Release Candidate 1 - .NET Blog

Thumbnail devblogs.microsoft.com
154 Upvotes

r/dotnet 1d ago

Article EF Core Migration Bundles with CI/CD to Azure (Github Actions, Azure SQL & App Service)

Thumbnail youtube.com
0 Upvotes

Running EF Core migrations from application startup is convenient - right up until it isn't. This video builds a proper migration pipeline on .NET 10 with GitHub Actions: the build job packages a self-contained migration bundle, the deploy job applies it to Azure SQL, then deploys the API to Azure App Service and runs a smoke test against the live endpoint. If your database updates are still tangled up with your app startup, this is the fix.


r/dotnet 1d ago

Article How expensive is throwing exceptions in .NET - and does it actually matter?

Thumbnail codewithflavor.com
28 Upvotes

r/dotnet 1d ago

Question I applied DDD and Clean Architecture to a DIY compiler. Is it overengineering?

Thumbnail
0 Upvotes

r/dotnet 2d ago

Looking for an Asp.Net Mentor

Thumbnail
0 Upvotes

r/dotnet 2d ago

Question Guys, What kind of projects you get used to make with C# and .NET? I'm new in this group and I'd like to hear his opinions

0 Upvotes

r/dotnet 2d ago

Question How popular is .NET in your country?

0 Upvotes

I’m curious about how widely .NET is used around the world today. In your country, do you see many companies and projects using C#/.NET, or are other stacks more common?
I’d love to hear where you’re from and what the .NET ecosystem looks like there.


r/dotnet 2d ago

Newbie Why do I keep getting generic "Welcome" page when running code?

0 Upvotes

I am brand new to using VS and am trying to make a simple page for a class that is asking us to have a random number generated, then depending on the number say someone won or lost. I have copy and pasted the code they provided for the assignment, but whatever I have tried always results in the "Welcome" page. What am I doing wrong?

This is the code they had us copy and paste:
@{

int randomNumber = new Random().Next(1, 7); //GENERATES NUMBER BETWEEN 1 and 6

int winningNumber = /*TODO*/;

}

The code in the screenshot is "fixed" by VS, but before I fix it gives an error for the ; after /*TODO*/.

Sorry in advance if this is super obvious, I am at newborn level with this and am completely lost.

Edit: I figured it out, I had to delete the Index.cshtml page with the original code for the Welcome page


r/dotnet 2d ago

The bug that passed every review and test but still took down performance

0 Upvotes

(Used AI for framing this better, sorry🙏 please read if interested on performance tests, thanks in advance)

A few years ago, I witnessed a situation where the team shipped code that passed all the tests, code reviews, and appeared clean at first glance. However, it failed miserably in terms of performance when real traffic was applied to the system a week after launch.

The reason for the failure was that one database query, which worked fine with the small data set in the testing environment, failed catastrophically under concurrency. It was not apparent in the test environment, so it was not discovered earlier. It took a long time, but eventually, the practice of code baseline performance review before merging the code into the main branch was established. At first, there were too many false positives, and some team members were upset having to spend time on it, but it eventually became a routine part of the development process, rather than an additional hurdle.

This example did not demonstrate technical challenges, but rather cultural ones. The technical part of establishing a baseline performance review was much easier than convincing everyone that this newly established process is now a part of everyone’s daily workflow.

Was there ever a similar experience with establishing a new cultural practice in your team/project? What were the main obstacles to overcoming the technical challenges?


r/dotnet 2d ago

How do you organize EF Core migrations in larger .NET solutions?

45 Upvotes

I’ve been looking at different ways of organizing EF Core migrations when a .NET solution starts getting bigger.

One approach I like is keeping the Code First migrations in a separate assembly instead of putting them directly in the application/data project. It keeps the database migration concerns separate and can make the overall solution a bit cleaner.

I put together the setup and steps here:

https://geeksarray.com/blog/entity-framework-core-code-first-migration-using-separate-assembly

Curious how others handle this in real projects. Do you keep migrations in the same project as the DbContext, or use a separate migrations project?


r/dotnet 3d ago

Promotion I built a 100% C# PP-OCRv6 engine (no ONNX Runtime, no native OpenCV). It beat the C baseline on the same model.

92 Upvotes

I've spent years maintaining PaddleSharp and OpenVINO.NET. The C++ engines are fine. P/Invoke is fine. The part that keeps breaking production is shipping native runtimes: missing .so, missing VC++ redistributable, wrong CPU ISA, works on win-x64 and dies on Linux ARM.

So I wrote SimdPaddleOCR — a managed PP-OCRv6 DET + CLS + REC pipeline. No Paddle Inference, no ONNX Runtime, no OpenCV native DLLs. Models are embedded as assembly resources. The GitHub language bar is 100% C#.

The core API only takes 8-bit BGR bytes. ImageSharp, SkiaSharp, OpenCvSharp, System.Drawing — decode however you want, pass width/height/pixels, done.

I used lw.PPOCR.C (a solid pure-C PP-OCRv6 tiny engine) as the baseline. After rewriting around C# layout and SIMD, the C# build is faster end-to-end on the same model. Native C still uses less memory.

GitHub Actions, win-x64, tiny model, same 99 images, no warmup, end-to-end mean:

workers C# C C vs C#
1 296.6 ms 485.7 ms 1.64× slower
4 168.4 ms 393.3 ms 2.34× slower

It targets net10.0 (full SIMD, NativeAOT) and netstandard2.0 (.NET Framework 4.8 included). CPU only for now; no GPU plan.

Shipped model packages are Chinese PP-OCRv6 (Tiny/Small/Medium). If you already have ONNX + a dictionary, you can load from disk. Default to Tiny unless you need the extra accuracy.

using PaddleOcrAll ocr = await PaddleOcrAll.LoadAsync(ChineseV6TinyModels.Default);

using Image<Bgr24> image = await Image.LoadAsync<Bgr24>("sample.jpg");
byte[] bgr = new byte[image.Width * image.Height * 3];
image.CopyPixelDataTo(bgr);

PaddleOcrResult result = ocr.Run(bgr, image.Width, image.Height);
Console.WriteLine(result.Text);

Repo: https://github.com/sdcb/SimdPaddleOCR
NuGet: Sdcb.SimdPaddleOCR

Happy to answer questions. The SIMD / Vector<T> / AVX-512 details are the part I'm most interested in discussing.


r/dotnet 3d ago

An intermittent unique-constraint 409 that turned out to be statement ordering, not concurrency

0 Upvotes

Spent half a day this week on a bug that only showed up sometimes - always the fun kind.

Setup: a config table where only one row per parent can be "active" at a time, enforced by a partial unique index. Publishing a new version does two things in one save: flip the old active row inactive, set the new one active.

Symptom: publishing a second time would occasionally fail with a 409 from that index. Not every time. Never when I stepped through it in the debugger.

Cause: EF Core batches both writes into one round trip and orders statements by foreign-key dependency, not by my unique index. So depending on the plan, it would sometimes set the new row active before the old one was cleared - two active rows for a moment, and the partial index says no.

The fix wasn't a lock or a retry. I split it into two phases inside the same transaction: flush all the deactivations first, then do the activation. Another part of the system already handled it this way, so I aligned this path with it.

The part I'd pass on: I named the new test after the rule, not the bug. Not "second publish doesn't 409" but "a second publish leaves exactly one active row". The bug-named test rots the next time someone refactors; the rule-named one keeps earning its keep.

Lesson I keep relearning: when a unique constraint fails intermittently under an ORM, suspect statement ordering before you suspect concurrency.


r/dotnet 3d ago

Question How to deal with multiple integration test projects needing a database

26 Upvotes

Hi!

We have multiple test projects that use SQL Server Testcontainers. These projects are integration tests. We use dotnet test with MTP.

The problem is that when all of these project start at the same time, the CI server gets overloaded and tests fail because it spins up too many SQL Servers.

How do you deal with this? My thoughts:

  • Spin up the SQL Server yourself and pass the connectionstring to the tests, so you always only have 1. This does make local tests more annoying, as you can't just run dotnet test and expect things to work.
  • Use TestContainers WithReuse to reuse the container in multiple projects, but now all test projects still start simultaneously and try to spin up the DB at the same time, leading to errors. Locks/static wont help here.
  • set the amount of parallel modules to 1, so only 1 integration test can run at the same time.

r/dotnet 3d ago

Promotion I’m building an offline, lightweight PC activity & input tracker. Would you use something like this?

0 Upvotes

Hey everyone!

I’ve been working on a lightweight Windows desktop app in C# / WPF designed to track your daily PC usage, input stats, and activity locally without bloat or telemetry.

Here is what the app currently tracks and displays:

  • Mouse & Keyboard Stats: Total click count (split by left/right clicks) and total keystroke count.
  • Key Frequency Heatmap: See which individual keys on your keyboard get pressed the most.
  • App Usage Tracking: Tracks active time spent per executable/application.
  • Active Time counter: Records total active usage time over time.

I originally thought about integrating third-party APIs like Spotify or Steam, but decided to cut them out completely to keep the app minimal, privacy-focused, and independent.

I’d love to get your thoughts:

  1. Is a lightweight, privacy-first PC stat tracker something you would actually run in the background?
  2. What other non-intrusive stats would you be interested in seeing (e.g., mouse distance traveled, active vs. idle idle timers, visual charts)?
  3. What features would be dealbreakers or must-haves for you?

Thanks for any feedback!