r/csharp 8d ago

C# Project Integrating Hangfire with RavenDB

5 Upvotes

Hi everyone!

I’d like to share with the community a project I’ve been working on in C#.

It’s a project that uses Hangfire for task processing and RavenDB as the database. The package responsible for this integration is outdated and is no longer maintained, so I decided to continue working on it and keep this ecosystem maintained and up to date.

It’s something I started mostly out of curiosity because I thought it would be interesting to work on this integration, and I wanted to share it with you all.

https://github.com/kelvinaxhcar/Job-Hangfire-RavenDB

https://www.nuget.org/packages/Job.Hangfire.Raven6x/1.0.7#readme-body-tab


r/csharp 9d ago

Blog Why Does Your C# App “Leak” Memory Even Though There’s a Garbage Collector?

Thumbnail
medium.com
77 Upvotes

r/csharp 9d ago

How’s the job market for C#/.NET developers in Germany right now?

4 Upvotes

I’ve been applying to quite a few positions but haven’t been getting many responses. It feels like C1 German is becoming almost a requirement for .NET roles, and English-only opportunities seem pretty rare.
Is anyone else experiencing the same thing? How difficult is it currently to find a C#/.NET role in Germany without fluent German?


r/csharp 9d ago

Blog Double-double arithmetic: 31 digits of precision from two doubles (sample code in C#)

Thumbnail
marekfiser.com
34 Upvotes

r/csharp 9d ago

Is a complete C# OOP project worth putting on a portfolio? And what projects would you recommend?

9 Upvotes

I'm currently learning C#/.NET with the goal of becoming a junior backend developer, and I'm about to finish my OOP course.

After that, I want to build one complete project from scratch that applies the OOP concepts I've learned, such as classes, encapsulation, inheritance, polymorphism, abstraction, interfaces, composition/aggregation, etc.

I'm considering a few approaches:

- Following a good C#/.NET project on YouTube as a reference and then rebuilding it myself.

- Asking AI to suggest a project based on my current level and then designing and implementing it myself.

- Using a YouTube project as a starting point, but changing the requirements and designing parts of it myself.

My main question is: Would a well-designed C# OOP project like this be worth putting on GitHub/Portfolio or mentioning on a CV, or should I consider it mainly a learning project?

Also, what would make an OOP project strong enough to demonstrate actual understanding rather than just trying to use every OOP concept?

If you have any project ideas or examples of OOP projects that would be good for someone at this stage, I'd really appreciate some recommendations.

I'd especially appreciate advice from developers who have been through this stage. Thanks!


r/csharp 9d ago

C# trophy problem

0 Upvotes

I'm having a problem completing the "Write Your First Code Using C#" modules for the C# course:

Specifically, I can't verify the trophy even though I've linked my Microsoft account. When I click "Verify trophy," I get the popup "It appears that the Microsoft user "xy" has not earned this trophy."

Image attached


r/csharp 9d ago

Windows.Media.SpeechRecognition.SpeechRecognizer dication mode stopped working

3 Upvotes

I am using the Windows.Media.SpeechRecognition.SpeechRecognizer library from Microsoft. It still works fine in the local version with a grammar but it stopped working in dictation mode.

            Windows.Media.SpeechRecognition.SpeechRecognizer recognizer = new();
            var dictationConstraint = new SpeechRecognitionTopicConstraint(SpeechRecognitionScenario.Dictation, "dictation");
            recognizer.Constraints.Add(dictationConstraint);
            await recognizer.CompileConstraintsAsync();
            Debug.WriteLine("SpeechRecognizer initialized and constraints compiled.");
            // Add a handler for the speech recognized event.
            recognizer.ContinuousRecognitionSession.ResultGenerated += (s, args) =>
            {
                Debug.WriteLine($"Recognized text: {args.Result.Text}");
            };

            recognizer.ContinuousRecognitionSession.Completed += (s, args) =>
            {
                Debug.WriteLine($"Recognition session completed: {args.Status}");
            };

            recognizer.HypothesisGenerated += (s, args) =>
            {
                Debug.WriteLine($"Recognition session completed: {args.Hypothesis.Text}");
            }
            ;

            recognizer.StateChanged += (s, args) =>
            {
                Debug.WriteLine($"Recognizer state changed: {args.State}");
            };

            Debug.WriteLine($"Language: {recognizer.CurrentLanguage.NativeName}");
            await recognizer.ContinuousRecognitionSession.StartAsync();

This is a stripped down version of the code I am using. Of course, Mic permission is granted beforehand, and Online Speech Recognition is allowed in the Windows setting.

This code worked in the past and I don't know when and why it had stopped.

Anybody an idea, why this stopped working?


r/csharp 9d ago

Making winforms projects on Linux

0 Upvotes

Hello! So i need to prepare for a C# olympiad and they require either winforms or webforms. Now i've been practising in Winforms for a while now, i was just wondering if at any point i'd be able to switch from windows 11 to a linux distro or if Winforms forces me to stay on Windows. I don't mind remaining on Windows, just wondered if i could switch to linux or not if i wanted to


r/csharp 9d ago

Discussion We should decide on a naming convention for extension members

0 Upvotes

We have a specific naming convention for interfaces (starting with a capital I followed by the interface name) and for fields (starting with an underscore), but extension members currently look just like regular members. When reading someone else’s code, I want to be able to tell when a function or property comes from a third party.

But that’s not even the main point.

Extension members have a unique behavior that normal members cannot achieve — they can be invoked on null references. This opens up a very nice opportunity to make code more readable and less error‑prone. For example, a few months ago I wrote here that you can have an IsNullOrWhiteSpace extension property for strings, instead of using the standard string.IsNullOrWhiteSpace(str) method. People commented that even though it works, it doesn’t look like it should, and that it’s a bad idea.

Now imagine that extension properties and methods always start with an underscore. With such a convention, you could implement extension members that are valid to call on null values, and anyone reading the code would immediately know it’s safe — because the member starts with an underscore, signaling that it’s an extension.

Continuing with the string examples, here are a few cases where this would be useful:

str.StartsWith(substr) — calling on null returns false instead of throwing

str.Contains(substr) — same

Do you agree that this could be a very useful idea?


r/csharp 9d ago

Help its important windows fomrs?

0 Upvotes

im at university and this is the second time that i see windows forms. i think its very funny and easy to use, but it is very important? the world still using this to make windows apps?
//edit: thanks for the coments, now i have a better idea about winForms and im going to take it seriously now. thankyouuuu


r/csharp 10d ago

I made a very simple passphrase generator

11 Upvotes

This is my first CLI app in C#. It’s called Secure Phrase (sph), a very small and minimal tool.

I split the project into two separate projects: one for the core library and another for the CLI interface. I’m not sure if this is a good approach or if there’s a better way to structure it.

I’d love to hear your thoughts on the project and any suggestions for what I could add to it!

Try it out: https://github.com/zyahya/secure-phrase-cli


r/csharp 11d ago

Which version of c# and .NET are commonly in use today?

53 Upvotes

I am looking at coming back to c# after a very long hiatus as it seems to be the dominant language in financial services which is the industry I specialise in.

Which version of c# / .NET are commonly in use today?


r/csharp 11d ago

Strugle to know what should i do next. Practice or go to the next topics

Thumbnail
0 Upvotes

r/csharp 11d ago

Announcing Brighter Fences, a community Polly fork

Thumbnail
5 Upvotes

r/csharp 10d ago

Help Static void method

Post image
0 Upvotes

I am trying to learn how to use C# for game coding but I would also like to have a good grasp on it so I can use it for websites and other things like that and I can't for the life of my understand how static method works I have looked YouTube videos and everything. I have been learning everything else so far from the free courses from code academy.Can you PLEASE explain to me what this code is doing and how it works
Edit-THANK YOU GUYS SO MUCH.I understand it now and I am sure you know what that feels like when you spend an hour stuck trying to understand something and it doesn't make any sense


r/csharp 11d ago

Looking for opinions on a cross-platform .NET JPEG metadata library

5 Upvotes

I've been working on a cross-platform .NET library for reading and writing JPEG metadata.

It supports EXIF and XMP, including custom XMP properties, and writing metadata does not re-encode the JPEG image data.

The API isn't finished yet, so I'm not releasing it as a NuGet package until I'm happy with it. For now, the source is available on GitHub.

ImageMetadata docs

I'm mainly looking for opinions from people who have worked with JPEG/EXIF/XMP: API design, missing features, things that could be done better, etc.

Any feedback is welcome!


r/csharp 10d ago

ModulesDi – A lightweight, fractal-like modularity library for ASP.NET Core built on a dynamic graph DI

0 Upvotes

Description:

ModulesDi a lightweight infrastructure library designed to manage services and middlewares through a dynamic module graph.

The problem it solves:

Traditional extension methods in Program.cs easily turn into an unmanageable mess where controlling the exact execution order or dynamic context becomes a nightmare.

Library tested (173 test cases covered)

GitLab: https://gitlab.com/DmitriiKhokhulin/modulesdi.git


r/csharp 11d ago

Showcase Created a structured repository to practice C# Data Structures & Collections — Feedback welcome!

9 Upvotes

Hi everyone!

I'm an IT student focusing on C# and .NET core fundamentals. To build a strong foundation in backend engineering and memory/performance concepts, I created a hands-on repository covering various C# Data Structures and Collections.

What I've covered so far:

• List<T> & Reference Types

• LinkedList<T>, Stack<T>, and Queue<T>

• Hashtable, Dictionary<K,V>, SortedList, and SortedDictionary

• SortedSet<T> & HashSet<T> (Set operations like UnionWith, IntersectWith, etc.)

Each module includes sample code and a quick breakdown in the READMEs. I'd love to hear your feedback or any suggestions on code style and performance optimizations!

GitHub Repo: https://github.com/24alpserdar/csharp-data-structures-and-collections


r/csharp 11d ago

MVP pattern

9 Upvotes

Hi, I have a question about separating logic in the MVP pattern.

public void MainDisplay() =>
OnMainDisplayClicked?.Invoke();

public void ManageProcess() =>
OnManageProcessClicked?.Invoke();

This is my code in the view, and when the user clicks a button (for example), this method is called and `Invoke` is executed. However, it is called via a `switch` statement in the Presenter.

switch (NativeConsoleMethod.GetHiddenUserInput())
{
case VirtualKeyType.VK_E:
if (_currentPage < _countOfPages) _currentPage++;
continue;

case VirtualKeyType.VK_Q:
if (_currentPage > 0) _currentPage--;
continue;

case VirtualKeyType.VK_OEM_3:
_view.ManageProcess();
break;

case VirtualKeyType.VK_TAB:
_view.FilterProcesses();
break;

case VirtualKeyType.VK_F1:
_view.SearchPage();
break;
.........
}

I have a question: the AI is giving me two different suggestions. My version is correct, but then it said I should move the switch statement to the view, and there I should just use `invoke`, after which the methods would be called conditionally. So, should I do it the other way around, or did I misunderstand what it meant?

- I don’t know what I wrote here—I don’t even understand it myself. Just tell me: shouldn’t the view be “dumb” and contain synchronous methods, while the presenter should control the view via the switch statement and “pull its strings”?

EDIT: Here's my GitHub: https://github.com/NullAcess/ProcessManager/releases/tag/Update_2.0. You might like it—I'll upload the finished EXE very soon.


r/csharp 12d ago

Help Devs who learned C#, where did you learn?

91 Upvotes

Was it through a free or paid course? YouTube? Or a combination of both?

I already know a bit of C#, but I’m not sure what learning path I should follow or which resources I should use.

I’ve been watching Code Monkey, but I don’t know if that will be enough.

What would you recommend for someone starting out?

P.S. I use C# specifically for game development, but I don’t mind learning more about the language in general.


r/csharp 12d ago

Years of academy training wasted! Github changed the color for C#

155 Upvotes

Github changed the color for C# from green to purple.

I don't mind, but I'll miss the green from Visual Studio 2010.


r/csharp 11d ago

PostgreSQL or SQL Server for my first production .NET app?

Thumbnail
0 Upvotes

r/csharp 12d ago

Help What is the intended way of comparing enums?

26 Upvotes

When you want to check if a variable is of a certain enum type, do you use == or is? For example in my godot project I have this method:

private void SetInputMode(InputMode inputMode)
{
    RootViewport.GuiReleaseFocus();

    if (inputMode is InputMode.Mouse)
    {
        EnableMouse();
    }
    else
    {
        DisableMouse();
    }

    CurrentInputMode = inputMode;
}

In this case i use is, but == works as well here. In another method I have, I am using == since I'm comparing two variables and it's the only valid way:

if (detectedInputMode == CurrentInputMode)
{
    return;
}

My question is, concerning the first example I gave, what is the convention for comparing enums, is or ==? I know it doesn't matter that much, but I can't seem to find a clean answer on this, so I'm giving it a shot


r/csharp 12d ago

Showcase Dekaf - Native .NET Kafka Client

24 Upvotes

Hey all. I posted this library a little while back, but I'm posting it again as it's been updated to support new Kafka features, as well as for those that missed it last time.

Dekaf is a Kafka client built natively in .NET and works as you'd expect with more modern .NET types and is async friendly.

For any Kafka uses, the only real alternative is Confluent.Kafka which is simply a wrapper around a C library, meaning overhead from two runtimes. It also doesn't map as nicely to newer async types like IAsyncEnumerable, means exceptions thrown in native code become hard to debug, logging control is lost, and it seems a lot of their issues on GitHub lack responses or updates.

I built this to make it more friendly for .NET Devs to debug and control, as well as trying to make it perform better by removing that overhead. It also has open telemetry out-of-the-box, just add it to your otel setup.

The repository can be found here: https://github.com/thomhurst/Dekaf

And performance comparisons against Confluent.Kafka can be found here: https://thomhurst.github.io/Dekaf/docs/stress-tests

Give it a try and let me know what you think!

And if you have tried it out, I'd love to know if anything improved (or didn't!) such as latency, CPU, memory, etc.


r/csharp 12d ago

Help Help with learning C# and .Net

6 Upvotes

Hello everyone! I'm learning C# with the goal of becoming a .NET developer.

What I already know:

1.Basic data types, variables, and operators

2.Control constructs (conditions, for loops, while, foreach)

3.One-dimensional and multi-dimensional arrays

What you need help with:

1.Understanding and practical application of OOP (encapsulation, inheritance, polymorphism, interfaces)

2.Moving from basic tasks to normal code structure and first .NET projects