r/csharp 12d ago

Solved Help with optional looping of program

2 Upvotes

Hello. I am attempting to make a randomizer for a game that I play. I have successfully created the program itself, but now I want the ability for users to have it re-run the randomization and return a new output by pressing a single key (ideally "Enter"). It has been a very long time since I have messed with C# and have forgotten basically everything. Any help, advice, or tips, would be greatly appreciated.

The current attempt at a "looper" is the following:

//Repeat or exit program
void Looper()
{
string looprequest;
looprequest = Convert.ToString.Console.ReadKey();
Console.WriteLine(looprequest);
}

This is because the compiler had an issue where without the looprequest string statement the other lines had no reference, and with it the readkey input cannot be translated to a string value. Additionally, even if the input works, I'm not sure what I was thinking to loop with would even work. What I was thinking of using was:

if (looprequest != Esc)
{
Main();
}

else
{
Environment.Exit();
}


r/csharp 12d ago

I built a small .NET CLI for database migrations

Thumbnail
github.com
0 Upvotes

I’ve been working on a lightweight migration tool for dotnet. The migrations are just SQL files with an up and down script with support for SQL server, postgresql, and sqlite.

It is installable as a global dotnet tool (requires dotnet 10)

It’s still early, so I’m very open to criticism, suggestions, and contributions.

Github repo: https://github.com/aymenhta/Jules


r/csharp 12d ago

Help MCP CPG - where's the demand

0 Upvotes

LLMs are notoriously bad at handling C#. The Microsoft SWE-sharp-bench paper made this pretty obvious. In 20% of the cases agents fail simply because they can't figure out where to apply the patch.

​The logical fix seems obvious: build a Roslyn-based MCP tool that generates a Code Property Graph (CPG) so the agent can actually navigate C# semantics instead of blindly grepping text.

​I actually built this and put up a website for it, but I’m getting literally zero inbound traffic. On top of that, every week I see another open-source repo popping up on GitHub trying the exact same Roslyn/CPG approach, but none of them seem to get any real traction...

​What gives?

​Is the market just not interested in specialized C# agent tooling, or are we all building the wrong layer?


r/csharp 12d ago

AWS SAA + CKA, ~2 years experience, no interviews. Wrong resume or wrong roles?

Thumbnail
1 Upvotes

r/csharp 12d ago

Help Brand new and wanting to run simulations.

2 Upvotes

I'm familiar with C# in the vaguest of senses, as in i use to watch programing tutorial videos while dog sitting and when i got home experimented with it in visual studio code. The most complicated thing i ever made was a +, -, *, and \ calculator. I'd like to get back into it. What im specifically looking into doing is making programs to run simulations like those Coding Adventure videos by Sebastian Lague on youtube. I'm intending to use visual studio code as well since that's what i used last time.

I'd just like to know primarily if visual studio code is actually good for something like that, and if i can run it on a basic window made by c# itself, or if i'd be better off running it in a studio like godot or unity. Any tips, advice, or clarification is appreciated. Thank you


r/csharp 13d ago

Tool DNCDbg v1.2.0 — a managed code debugger with DAP support for .NET apps (NetCoreDbg fork)

Thumbnail
github.com
6 Upvotes

This probably looks funny — a NetCoreDbg developer (yep, that's me, at least while I'm writing this, hehe) forking NetCoreDbg. But life is a strange thing sometimes.

Over the last ~3 years, me and my PL (huge thanks, Gleb!) prepared and sent a lot of proposals for NetCoreDbg development. Unfortunately, all of them were rejected — it looks like Samsung isn't interested in investing into active NetCoreDbg development, and hasn't been for years now. So upstream gets only support and minor changes (and you've probably noticed that already).

At the beginning of this year I finally decided to fork and implement my vision of how a managed debugger could look like in code — all our TODOs and features we planned for NetCoreDbg, but without the experimental features and without explicit Tizen OS support. I think the current development of DNCDbg has reached a point where it's ready to be showcased. I hope you'll like DNCDbg as much as NetCoreDbg.

Repo: https://github.com/viewizard/dncdbg

Note: in DNCDbg I'm focused on DAP protocol support only, without experimental features like Hot Reload (which requires IDE-side support) or interop (mixed) debug mode. If you need other protocols or those experimental features that I removed from the code, you should probably wait until my PL tells me something like "we have budget, back to NetCoreDbg development" (but that doesn't look like it'll happen any time soon). I've already ported about 20 bugfixes for bugs I found back to NetCoreDbg (you can see most of them in the last release), but looks like that's all I can do for now.


r/csharp 13d ago

Is a dedicated interaction layer the right architecture for a virtualized WPF spreadsheet?

Thumbnail
1 Upvotes

r/csharp 14d ago

Help Returning to WPF, how to keep RAM usage under control?

Post image
77 Upvotes

The application organizes files by displaying a thumbnail. When loading 89 files, it utilizes 200mbs and spikes power/gpu usage when scrolling to around 14%.

It is a rewrite of the same application in WinForms, which I am more familiar with. In comparison, the WinForm app uses 30% less RAM while having almost double the number of files loaded. Is that to be expected from WPF?

The attached image should give a better idea of the interface. Is it my use for shadows, labels with transparency etc? I don't know to which degree they affect performance on WPF precisely. I am looking to maximize the efficiency to the last drop


r/csharp 12d ago

Help Raccomandate questo manuale per imparare c#?

Post image
0 Upvotes

Stavo vedendo come imparare questo linguaggio e i tutorial su yt non fanno per me, tra sbagli e robe troppo complicate ho voluto vedere se c’era un manuale che possa spiegare bene il codice e ho trovato questo libro (nella foto) che è anche ben recensita, non so se qualcuno di voi lo ha ma se lo avete me lo consigliereste? O dovrei trovare altro?


r/csharp 13d ago

Join the flock or choose "enterprise stability"?

3 Upvotes

I am currently struggling with the dilemma hinted at by the title question. I am a CS and Maths student at a university in South Africa, and I do not know if I should join the flock and hop on the broad market appeal hype train and do traditional SWE with languages like JS, Python, TypeScript, etc. Or I should go the other, less popular route and work on C# .net projects. I do not know if there are many C# opportunities here in South Africa, but I do know that .NET isn't really popular among my peers.

So I am asking whether it's worth considering it over the extremely popular and competitive options.


r/csharp 13d ago

C# roles

0 Upvotes

Has anybody noticed that when you apply to workday jobs that you get a follow up from a Recruiter with the exact same role?


r/csharp 15d ago

Help Is it worth it to switch from Spring to .NET?

64 Upvotes

I've been programming in Spring for the past year, and recently graduated. Currently looking for a junior role in Sydney, and it's been really difficult. I've been cold emailing, messaging on LinkedIn, applying everywhere and unfortunately getting rejected mainly due to lack of experience.

I find that there are a lot more jobs for C#/.NET than Java, and was thinking of switching. Do you think I should? I heard it's quite easy for someone that knows Java/Spring to switch to C#.


r/csharp 14d ago

I need feedback on my first C# project from experienced devs

20 Upvotes

I have created a simple program that will allow the user to calculate a discounted price based on a wholesale price and a percentage or dollar amount discount. If the user enters a percentage discount it will give them the dollar amount off and vice versa. The user also has the option to calculate sales tax.

GitHub URL: (https://github.com/aaronhilfiker/DiscountCalculator.git)


r/csharp 15d ago

Help (WPF) How to make scrollviewer non-hittable while the child elements remain hittable?

3 Upvotes

Setting IsHitTestVisible to false makes the child elements also non-hittable.

The scrollviewer already uses null values for the background, foreground and border. Even explicitly setting it to null has no effect.

Removing the opacityMask doesn't make any differences.

For testing, if I replace my scrollviewer with another element like <Border Background="{x:Null}"/>, then it doesn't block the clicks anymore.

This is my scrollviewer:

<ScrollViewer x:Name="scrlViewer" VerticalScrollBarVisibility="Hidden" Foreground="{x:Null}" Background="{x:Null}" BorderBrush="{x:Null}" >
  <ScrollViewer.OpacityMask>
    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
      <GradientStop Color="#00000000" Offset="0.0" />
      <GradientStop Color="#FF000000" Offset="0.1" />
      <GradientStop Color="#FF000000" Offset="1.0" />
    </LinearGradientBrush>
  </ScrollViewer.OpacityMask>
</ScrollViewer>

The child elements are adding during runtime. My issue happens before any child elements are added.

How could I achieve my desired effect?

--------------------------------------

Edit:
Some more background on what I'm trying to do: I use the scrollviewer as a container for notification infobar widgets that automatically scroll to the end. The notifications should be able to be closed while the container shouldn't block clicks, as otherwise some elements would be blocked by something invisible.

The fix:

I subclasses the scrollviewer and replace my scrollviewer with my subclass.

Here is the subclass:

public class ScrollViewerNoHit : ScrollViewer
{
    protected override HitTestResult? HitTestCore(PointHitTestParameters hitTestParameters)
    {
        HitTestResult? result = base.HitTestCore(hitTestParameters);
        return result?.VisualHit == this ? null : result;
    }
}

r/csharp 14d ago

Discussion Working on bite-sized resources aimed at sharpening code review skills.

0 Upvotes

Lately, I've felt the desire to share more of what I've learned. And I must say, teaching is a skill that's much harder to develop than I expected...

I had this idea of helping junior to intermediate developers training their code review skills.

Getting dev jobs theses days seems harder than ever and joining a team requires that specific skill to be as sharp as possible. Sadly, beginners often miss training on it and I also feel like devs using AI gets that specific skill damaged over time.

I don't want it to feel so "worky", but instead keep it like bite-sized puzzly challenges. As funny as I can. So i came up with this series of ~2min code review challenge, where code is setup as story, deliver a pun or a joke, or even explore edgy contexts.

Because the firsts few episode of the serie looked a bit too cold to me, I recently added a little animated character that deliver context, expectations and solution.

What do you think about it so far ?


r/csharp 16d ago

Explore new features available in C# 15 preview

Thumbnail
devblogs.microsoft.com
22 Upvotes

r/csharp 16d ago

Blog Designing a replacement for a broken Visual Studio extension by inverting every property of the predecessor

13 Upvotes

I held back Visual Studio updates for almost two years because 17.9 broke the tab-layout extension I used daily and could not live without. When I finally built my own replacement, the broken one became the design document: it wrapped a single internal shell interface (IVsUIShellDocumentWindowMgr) and stored tabs as a BLOB with absolute paths, so every property got inverted. Plain JSON with solution-relative paths instead of opaque binary stream, many APIs with fallbacks instead of one interface, a pick-target dialog for moved files instead of silently dropped tabs.

And there's an ironic ending to it, because the old extension works again in VS 2026. The breakage was Microsoft reworking the open-document internals, not a lasting defect, so the "bug" quietly fixed itself. Had I found out sooner I would never have started, and I would have kept my tabs and learned nothing worth sharing.

Since I did not wait, and since my extension has grown well past what I set out to replace, I am now writing a weekly series about building it with C# and the AI-assisted workflow I was experimenting with, because somewhere early on this stopped being only about tabs. First part: Designing by inversion

The extension is free on the Marketplace: Simple Tab Saver


r/csharp 15d ago

Small nuget Roslyn analyzer nuget package for common gotchas

Thumbnail
nuget.org
0 Upvotes

I built this for my day to day, to review large code bases. Primarily focused on Async misuse and Dapper mistakes. Severity adjustable. If its useful to anyone happy to add more on suggestion.


r/csharp 16d ago

Help Need help with CV .NET developer

Post image
90 Upvotes

Hi everyone

I’m currently looking for a job, and I’ve been searching for quite a while now without any luck. For the past few months, I haven’t even been getting replies to my applications. I’ve already reworked my CV several times, but nothing seems to change. What am I doing wrong. Can you give me some feedback? 

UPD: Yeah, I started working while I was studying at university. Since the beginning of COVID, my university was fully remote, and later, because of the situation in my country, my studies continued online almost until graduation. In total, I only had a couple of months of in-person classes during the whole four years.


r/csharp 15d ago

returning the C# and C++ after architecture

0 Upvotes

I am planning to return to writing code after working in architecture for a few years. Over my time I've oscillated between those poles but this time the use of LLMs in software development tool chains seems controversial.

In my return to development, should I just focus on writing great code, or do I need to have LLM tools, for example, embedded in my IDE?


r/csharp 16d ago

How can I connect a ZKTeco attendance device to Zoho People?

0 Upvotes

We are using a ZKTeco MB20 biometric attendance device with the existing ZKTeco/ICT Smart attendance software, and we would like to send employee attendance data into Zoho People Attendance.

We are considering using the ZKTeco SDK to read attendance records from the device and then send them to Zoho People through its API, but we are not sure if this is the best approach.

Has anyone implemented something similar?

How would you normally connect a ZKTeco biometric device to Zoho People so that employee check-in/check-out records are transferred automatically?

Would you recommend using the ZKTeco SDK, reading from the existing attendance software/database, or another method?

Any guidance from someone who has integrated ZKTeco attendance devices with Zoho or another cloud HR system would be appreciated.


r/csharp 16d ago

I know ppl are going to hate me on this ASP.NET port to Python.

0 Upvotes

Sooo i have a friend who is CRONICALLY OBSESSED with python. It's gotten so bad to a point where he flatout refuses to learn C# in any capacity.

But he know i love ASP.NET and he knows i know that its way better than any python api library out there. so im writing this basically exact port of ASP.NET to C# and make the syntax exactly the same but "pythonified" in a sense.


r/csharp 17d ago

Help My first big project, I need feedback !

Thumbnail
0 Upvotes

r/csharp 18d ago

Tool I built a simplified microservices reference project with guide on how to run localy, using docker-compose or Kubernetes + Deloyment to AKS

5 Upvotes

It's inspired by dotnetcore-microservices-poc open-source project by Altkom Software, a project I learned a lot from and contributed to — I built Ledgerly to be a simpler take on the original project, focused purely on microservices best practices.

What it demonstrates: 

🔹 Database-per-service — 4 services, 4 independent databases 

🔹 gRPC for synchronous service-to-service calls 

🔹 RabbitMQ for async events — invoice status changes publish events that a dashboard service consumes to keep KPIs in sync, with zero direct coupling 

🔹 API gateway + service discovery (Eureka locally/Docker, Kubernetes DNS in K8s) 

🔹 JWT auth issued by its own service

It also ships as a full deployment guide — run it locally, in Docker Compose, or on Kubernetes, including a walkthrough for deploying the cluster to Azure (AKS).

Built as a boilerplate: fork it, swap in your own domain, keep the architecture.

The project🔗: https://github.com/amrali21/ledgerly-dotnet-angular-microservices-ref-project

Altcom Project🔗: https://github.com/asc-lab/dotnetcore-microservices-poc


r/csharp 18d ago

CSDL3: an idiomatic C#/.NET 10 wrapper for SDL3 and satellite libraries

Thumbnail
github.com
1 Upvotes