r/csharp • u/Direct_Cup_164 • 44m ago
r/csharp • u/Minimum-Ad7352 • 5h ago
Discussion Can I learn computer architecture and operating systems with C#?
I'm a full-stack developer, and I want to learn more about computer architecture and operating systems to become a better developer and understand what's happening under the hood.Can I learn these things with C#, or should I learn C first? Does the language even matter that much?What would you recommend?
r/csharp • u/delockdown • 6h ago
Help Is C# worth learning in the AI era? (Web dev background looking to future-proof)
Hey everyone,
I’ve been building things for the web using JavaScript, TypeScript, and PHP (Mostly). Up to now, it’s been a solid stack with a great job market. But with how fast things are shifting, especially with AI tooling changing the landscape. I’m trying to future-proof my skills and can't entirely predict where things are heading.
I keep hearing about C# and .NET as a robust enterprise choice, but I’m wondering how it fits into the current AI-driven era.
- For those of you working in C#/.NET right now, how has the job market and day-to-day work changed with AI code assistants?
- Is learning C# a smart pivot or addition for a web dev trying to stay relevant, or should I double down elsewhere?
Curious to hear your thoughts and experiences!
r/csharp • u/YouAreMyFire00 • 7h ago
About codebase conventions, who is actually right and who is wrong here?
Let's say you're a Technical Founder like Mark Zuckerberg or Bill Gates. You have a CS degree worked as mid level developer.
You've written some code (as show in the pic) and added comments to remind yourself and other developers what the code does, so nobody forgets in the future.
Now, you have a Senior Developer on your team who worships Uncle Bob's Clean Code principles like a cult!
she reviews your PR and reject it, saying
"Good code should be self-explanatory. The code itself should explain what it's doing.
Anyone should be able to look at it on the first time and understand it right away.
So go back and remove those comments. They're not clean! God damn it!"
--
What would you do in this situation?
Would you trust the senior dev and delete the comments because they have more experience than you, even though you're the founder and have less development experience than they do?
Ps. We have to move fast
r/csharp • u/chasingreflections • 8h ago
Help Anyone here built measurement/monitoring software in C#?
Hey, has anyone here worked on industrial measurement or monitoring software with C#?
I'm currently looking into rebuilding an older monitoring solution from scratch and still figuring out the right architecture.
We're talking different measurement devices, continuous data streams (up to 1k samples/sec per channel), older Windows PCs with 4 GB RAM, and ideally something that can run reliably for months.
What I'm a bit unsure about is the data integrity side of things, especially crash recovery, audit trails, and GMP requirements.
I'm leaning towards C#, probably with SQLite, but not sure if I'm overlooking something.
Would be really interested to hear from anyone who's built something similar. What would you do differently today?
r/csharp • u/No-Ice-2476 • 20h ago
Request for wisdom regarding VS when learning C#
Dear C# devs,
My main language is python, but due to work I got exposed to C#, and would greatly benefit from learning it. I already am mostly familiar with the language's syntax due to some C++ exposure, but I am far from familiar with many C# concepts and the visual studio editor. In summary, I am a beginner to the language, but not to programming. I can write simple programs, but heavily lack the knowledge of C#'s environment such as projects, solutions, their respective settings, how to link DLLs and set up tests within visual studio.
I strongly feel that visual studio code is abstract (albeit efficient) in the way it performs those tasks and like it prevents me from learning what is actually going on. All I am learning is that I should click seemingly arbitrary submenu A, then B and then C. Voila, you now can run tests. Why? I have no idea.
To actually get an understanding of C#'s environment I therefore am considering omitting VS entirely and instead develop through the CLI. Hopefully, that way I actually learn what the .NET framework is, and how to work with it, how to set up projects, solutions, go through the compilation processes,and more.
I just wanted to ask the true C# veterans among us whether this proposed learning approach is a good idea, or whether I am missing something.
All constructive feedback is greatly appreciated.
Good night everyone!
r/csharp • u/Original_Bullfrog_61 • 1d ago
What is the most anticipated feature of the language that is not included in C#15 for you?
It 's coming up very soon .NET 11 and C#15, all the innovations are already known (at least in C#). Which of the non-products or proposals would you like to see in the next versions?
r/csharp • u/kaatarina_zed_talon • 1d ago
Discussion Is it justified to create an interface in this specific case ?
An Admin panel is to be made.
There is a piece of code that paginates users ; instead of showing 50 users in one page in the admin panel, the users are split across 5 pages, so each page shows 10 users.
I recognized that I should also paginate products.
should I make IPaginator<T> interface with two concrete implementations, ProductsPaginator<Product> and UsersPaginator<User> ?
If that is wrong, then what do you suggest ?
EDIT:
I think that is wrong, because maybe the implementation of the pagination logic is the same in both cases, what is different is the input; in the first implementation, the input is all the products , for the second implementation the input is all the users, so what is actually different is the input, not the implementation, therefore it is better to make Paginator<T> ?
Also there is another question:
When the user clicks on the page number 1, should the data come from the database or from a cache ?
How do you normally design the pagination feature ?
Second edit :
I realized that I neither need interface nor a class, I can just use the skip and take methods that LINQ offers.
r/csharp • u/JustSoni • 1d ago
NET MVC multilingual website: JSON vs RESX vs separate Razor views
r/csharp • u/NoisyJalapeno • 1d ago
Tip Indexing into a Vector is slow, store to stack first
Needed to fall out of vectorized back to scalar,
- 22.19 us to store to stack and read from stack
- 24.12 us to index into a vector directly
Discovered when I was optimizing DrawSpans8,
public static void DrawSpans8_Fast(ESpan_t* pspan)
{
/* Other code omitted for brevity */
int* idx = stackalloc int[Vector256<int>.Count];
ulong* idx64 = (ulong*)idx;
do
{
Vector256<int> sV = Vector256.Create(s) + Vector256.Create(sstep) * indexV;
Vector256<int> tV = Vector256.Create(t) + Vector256.Create(tstep) * indexV;
((sV >> 16) + (tV >> 16) * cachewidthV).Store(idx);
// Fast
ulong i01 = idx64[0], i23 = idx64[1], i45 = idx64[2], i67 = idx64[3];
} while ((pspan = pspan->PNext) != null);
}
public static void DrawSpans8_Slow(ESpan_t* pspan)
{
/* Other code omitted for brevity */
do
{
// Omitted
Vector256<int> sV = Vector256.Create(s) + Vector256.Create(sstep) * indexV;
Vector256<int> tV = Vector256.Create(t) + Vector256.Create(tstep) * indexV;
Vector256<ulong> idxV = ((sV >> 16) + (tV >> 16) * cachewidthV).AsUInt64();
// Slow
ulong i01 = idxV[0], i23 = idxV[1], i45 = idxV[2], i67 = idxV[3];
} while ((pspan = pspan->PNext) != null);
}
r/csharp • u/AdAdorable8877 • 1d ago
Busca por referência para aprender c#
Estou a 3 meses trabalhando com c#, meu primeiro emprego como desenvolvedor, porem sinto dificuldades em encontrar definições CLARAS de alguns conceitos. Como um exemplo, o conceito de coleções, a página da microsoft learn não define muito bem o que é isso, a I.A me da definições mas em geral não gosto de pesquisar esse tipo de coisa nela. Então pergunto, existe algum livro/curso bom para que eu obtenha essa base, se não, aceito algumas dicas pra melhorar meu auto-ditatismo.
r/csharp • u/jonas1ara • 1d ago
Update: I added interactive CLI execution and in-depth explanations to the 73 Design Patterns repo
Hey everyone,
A while ago, I shared my repository implementing 73 design patterns in C# (previous post).
Following community feedback, I just rolled out two major updates to make the project much easier to navigate and learn from:
- Interactive CLI runner: Instead of digging through multiple entry points or modifying code to run a specific pattern, you can now run everything from a centralized CLI menu. Select any pattern by category/name, run it immediately, and inspect the console output.
- Complete, in-depth documentation: Every single pattern now includes a dedicated breakdown explaining the core problem it solves, the structural mechanics behind it, when to use it, and practical trade-offs in modern .NET.
- F# solutions for the final problem of each topic: Added an F# implementation for the capstone problem of each category. Rather than forcing purity where it hurts LeetCode performance, it explores an idiomatic, functional-first perspective—contrasting immutable pipelines, tail-recursion, and pattern matching against pragmatic imperative optimizations where arrays and mutable state make sense.
The repo covers everything from classic Gang of Four patterns to Enterprise, Cloud/Distributed, and Concurrency patterns in idiomatic C#.
Check it out here:
https://github.com/jonas1ara/73
Would love to hear your thoughts, feedback, or any edge cases you’d like to see covered!
r/csharp • u/North-Asparagus6218 • 2d ago
Convertino: a drag-and-drop radial file converter in .NET 10 (WPF + Avalonia), with an OLE drop target and global input hooks
Sharing a side project and some of the less obvious parts of building it.
The app: drag any file, tap Shift, and a radial menu opens under the cursor. Drop on a petal to convert (images, PDF, Office, Markdown, video) or edit (crop, annotate, redact, AI cut-out).
Interesting bits:
- Windows: WH_KEYBOARD_LL / WH_MOUSE_LL hooks on their own thread, plus a layered, topmost, non-activating WPF window that acts as an OLE drop target. IDropTargetHelper keeps Explorer's drag image and sets the "Convert to PNG" caption via DropDescription. Effects are copy-only, so Shift ("move") never deletes the source.
- Linux: Avalonia 12 for XDND drops, an override-redirect window, XShape. Input is polled through XQueryPointer/XQueryKeymap because Wayland doesn't allow global hooks.
- macOS: Avalonia plus NSVisualEffectView for real system blur. Mouse/modifier state is polled via CGEventSourceFlagsState, which works without Input Monitoring.
- Shared core: a catalog of petals per file kind, jobs with progress/cancel, ImageMagick, PdfPig + PDFsharp, ONNX Runtime (DirectML on Windows) for BiRefNet background removal, and a CLI using the same engine.
MIT: https://github.com/hasanzadee/convertino. Happy to answer questions about any of it.
r/csharp • u/Ok_Disk_4458 • 2d ago
Fun Funny mistake I made
I'm learning C# for fun and wrote the simplest possible calculator, just to try combining loops, WriteLine, ReadLine and other basic commands. There was one problem, though. I couldn't for the life of me figure out how to include decimal numbers into that. Went through a couple sites and nothing. My result would always be a whole number with the decimal point removed, meaning it would be 10^x times bigger depending on the amount of decimal places the input had. Then I thought of using a comma in the input instead of a dot. I didn't think it would work, but... it did. Kinda dumb not to try that immediately, right?
r/csharp • u/BunnyTub • 2d ago
Does Velopack have a way to NOT install automatically on run?
The users of my app sometimes have trouble figuring out that the app has installed after they run the installer executable.
I'd like to know if there would be some way to have a dialog appear that asks the user if they'd want to install the app, and also have additional options to configure, like where to install.
r/csharp • u/kaatarina_zed_talon • 2d ago
Help Generate plots using BenchmarkDotNet
Some context:
WorkSheetToDbSyncronizerV2 service is to be benchmarked, and plots are to be shown.
WorkSheetToDbSyncronizerV2 ensures that the data in a database matches the data in an Excel worksheet.
There are multiple versions of that service, thus the suffix V2 .
Inputs to WorkSheetToDbSyncronizerV2 are Stream and CancellationToken —the latter is not shown in the code.
The general mechanism is that SqlBulkCopy class bulk-inserts the Excel data into a staging table then the data from that table is mapped to the target tables in the database.

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Exporters;
using BenchmarkDotNet.Running;
using HardwareStore.Models;
using HardwareStore.Services.ActorIdGetterServices;
using HardwareStore.Services.AdminServices.ImportProductsFromExcelFile;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using BenchmarkDotNet.Loggers;
namespace MyBenchMark
{
[Config(typeof(Config))]
public class Config : ManualConfig
{
public Config()
{
AddExporter(RPlotExporter.Default);
AddLogger(ConsoleLogger.Default);
}
}
public class ActorIdGetter:IActorIdGetter
{
public string GetActorId()
{
return "a1f28e89-2ba1-493e-b005-744decdd78b3";
}
}
[MinColumn, MaxColumn]
public class SyncronizationService
{
private readonly DbDataReaderGetter _dbDataReaderGetter=new DbDataReaderGetter();
private readonly BulkInserter _bulkInserter=new BulkInserter();
private readonly IActorIdGetter _actorIdGetter=new ActorIdGetter();
private readonly ApplicationDbContext _context;
private readonly WorkSheetToDbSyncronizerV2 _syncronizerV2;
public SyncronizationService()
{
IConfiguration configuration = new ConfigurationBuilder()
.SetBasePath(Path.GetFullPath(
@"D:\Training\NETLEARNING\EF_learning\HardwareStore"))
.AddJsonFile("appsettings.json")
.Build();
string connectionString =
configuration.GetConnectionString("HardwareDB")
?? throw new InvalidOperationException(
"Connection string 'HardwareDB' was not found.");
var contextOptions = new DbContextOptionsBuilder<ApplicationDbContext>()
.UseSqlServer(connectionString)
.Options;
_context = new ApplicationDbContext(contextOptions);
_syncronizerV2=new WorkSheetToDbSyncronizerV2(_dbDataReaderGetter, _bulkInserter,_actorIdGetter,_context);
}
[Benchmark(Baseline =true)]
public async Task SyncronizeV2()
{
await using var stream = File.OpenRead(
@"D:\Training\NETLEARNING\EF_learning\HardwareStore\Available_Products\Excel2.xlsx");
await _syncronizerV2.SyncronizeAsync(stream);
}
}
public class Program
{
public static void Main(string[] args)
{
var summary = BenchmarkRunner.Run<SyncronizationService>(new Config());
}
}
}
Result:
// * Export *
BenchmarkDotNet.Artifacts\results\MyBenchMark.SyncronizationService-measurements.csv
BenchmarkDotNet.Artifacts\results\BuildPlots.R
BenchmarkDotNet.Artifacts\results\*.png
// * Detailed results *
SyncronizationService.SyncronizeV2: DefaultJob
Runtime = .NET 10.0.11 (10.0.11, 10.0.1126.37416), X64 RyuJIT x86-64-v3; GC = Non-concurrent Workstation
Mean = 1.876 s, StdErr = 0.051 s (2.72%), N = 87, StdDev = 0.476 s
Min = 1.078 s, Q1 = 1.597 s, Median = 1.640 s, Q3 = 1.942 s, Max = 3.415 s
IQR = 0.345 s, LowerFence = 1.080 s, UpperFence = 2.460 s
ConfidenceInterval = [1.702 s; 2.050 s] (CI 99.9%), Margin = 0.174 s (9.27% of Mean)
Skewness = 1.54, Kurtosis = 4.31, MValue = 2.15
But there is no image in the results folder :

The following message is shown in BuildPlots.log :
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.6/gdata_3.0.1.zip'
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.6/tidyr_1.3.2.zip'
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.6/gridExtra_2.3.1.zip'
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.6/Rcpp_1.1.2.zip'
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.6/R.devices_2.17.4.zip'
Error in desc[1L, "Type"] : subscript out of bounds
Calls: install.packages -> .install.winbinary -> unpackPkgZip -> %in%
In addition: Warning message:
In unzip(zipname, exdir = dest) : write error in extracting from zip file
Execution halted
How can this be solved ?
r/csharp • u/AdChemical5855 • 3d ago
Hello, I want to share my free open source.
It's web CMS.
I hope this proves helpful to those who wish to manage their time, money, and documents using a personal server.
It took about 5 years to make it.
It currently in operation on the following site.
You are free to use the demo account provided on this site for logging in!
DDD + CA & Unit test & CI/CD applied.
r/csharp • u/Famous_Pitch_7483 • 3d ago
News TMS .NET Maps open beta: one map control for WinForms, WPF, .NET MAUI and Blazor
I work at TMS Software. We've released TMS .NET Maps as an open beta on nuget.org: a map control for .NET 10 with the same API in WinForms, WPF, .NET MAUI (Android, iOS, Mac Catalyst, Windows) and Blazor. It also includes geocoding, directions, places search and a few other services that work without the map control, for example in an ASP.NET Core API.
Providers include Google Maps, Azure Maps, HERE, Mapbox and Leaflet with OpenStreetMap, which needs no API key, so you can try it without signing up anywhere else.
To try it, install the package for your framework from NuGet and request a free beta key at https://www.tmssoftware.com/site/tmsdotnetmaps.asp
The beta builds work until December 31, 2026 and aren't meant for production yet. We're looking for feedback on the API and on what's missing for your use case.
Full announcement with code samples: https://www.tmssoftware.com/site/blog.asp?post=2532
r/csharp • u/Dangerous-Ask7465 • 3d ago
Help How do I get a lighter Windows blur behind a rounded, always-inactive overlay window that still shows in screenshots? (Win10/Win11)
I’m building a small always-on-top overlay for Windows: a pill-shaped window at the top centre of the screen that animates its size. I want it to look like frosted glass: a light blur of whatever is behind it, like TranslucentTB’s “Blur” mode. I’ve hit a wall and would love ideas from anyone who has done this.
Setup: Win32 popup, WS_EX_NOREDIRECTIONBITMAP | WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE | WS_EX_TOPMOST, drawn with Direct3D + DirectComposition (Skia on top). The window is never activated. Tested on Windows 10 22H2 and Windows 11 (build 26300), on a laptop with Intel + NVIDIA graphics.
Requirements:
- The blur follows a rounded pill shape that changes size every frame.
- It works while the window is inactive (it never gets focus).
- It stays visible in screenshots and screen recordings (Snipping Tool, OBS).
- The blur is lighter than Windows 11 Acrylic. Acrylic hides too much of what’s behind it.
What I tried:
- Windows.UI.Composition host backdrop (
DWMWA_USE_HOSTBACKDROPBRUSH+Compositor.CreateHostBackdropBrush()on aDesktopWindowTarget, clipped with aCompositionRoundedRectangleGeometry). Works on Win11, rounded, visible in captures, stays on while inactive. But the blur strength is fixed and heavy. A lighter tint on top doesn’t help, because it’s the blur itself that hides the background. Is there any way to get a weaker blur out of it, or to feed an unblurred backdrop into an effect graph with my ownGaussianBlurEffect? As far as I can tell,CreateBackdropBrush()only sees the app’s own visuals. - Reading the screen myself (DXGI Desktop Duplication, falling back to GDI BitBlt) and drawing a refraction shader. Looks great, but the window then has to use
SetWindowDisplayAffinity(WDA_EXCLUDEFROMCAPTURE), or it captures and refracts itself. That flag hides it from every capture, so it disappears from screenshots and recordings. - Magnification API with
MagSetWindowFilterList(MW_FILTERMODE_EXCLUDE, ...)to read the screen without my own window.MagSetImageScalingCallbackgives all-zero pixels on both Win10 and Win11 (with and without an identity transform, host shown or hidden, andPrintWindowwithPW_RENDERFULLCONTENTon the host). SetWindowCompositionAttributewithACCENT_ENABLE_BLURBEHIND/ACCENT_ENABLE_ACRYLICBLURBEHINDon my own popup (extended frame, no painting). The rounded window region (SetWindowRgn) is ignored, and in a GDI screenshot the area comes out black.DWMWA_SYSTEMBACKDROP_TYPE = 3(Acrylic) turns into a solid fill because the window is inactive.
Questions:
- Is there a supported or semi-supported way to get a lighter blur (like the old accent “blur behind”) clipped to a rounded, animated shape, on a window that’s never active?
- Is there any API that reads the screen while leaving out one specific window, so I can draw the blur myself without hiding the window from captures?
- How do apps like TranslucentTB get a stable, light blur on Windows 11? Is it only because the taskbar is Explorer’s own rectangular window?
Any pointers, even “that isn’t possible, here’s why”, would help a lot. Thanks!
r/csharp • u/eriklieben • 3d ago
Blog Labcoat: a web UI for Microsoft.Testing.Platform / your Aspire dashboard
galleryr/csharp • u/Traxexexs • 3d ago
«Я изучаю C# с помощью ChatGPT. Я уже прошел темы: переменные и типы данных, условные операторы (if/else), конструкции switch и циклы (while, do while, for).
У меня есть большая цель — написать кроссплатформенное приложение-планировщик (для Windows и Android) с общим сервером и множеством функций, а в будущем использовать этот проект для устройства на стажировку в IT-компанию. Однако мне кажется, что ChatGPT дает слишком мало практики и программист из меня получится так себе.
Посоветуйте, пожалуйста, из каких надежных источников лучше всего брать теоретическую информацию и качественную практику по этой теме».
r/csharp • u/Substantial-Night877 • 3d ago
Help .Net interview preparation
Hi everyone!
I’m preparing for a Senior .NET Developer interview, and I was told that the interview will include a code review exercise and coding challenges.
Has anyone here recently gone through a similar interview, particularly for a Senior .NET / C# position? I’d really appreciate any tips on what to expect and how best to prepare.
r/csharp • u/kaatarina_zed_talon • 4d ago
Help List<T> in C# vs SQL
In C#, list of strings would be defined as :
List<string> x
A stored procedure is to be written, it should receive a list of values; SQL does not support List<T> , should I use table-valued parameters instead?
EDIT
The reason this question was asked is the fact that the application C# code has only one responsibility which is to bulk-insert data into a staging table:
public async Task BulkInsertProductsToStagingTable(DbDataReader dbDataReader, CancellationToken cancellationToken)
{
using (SqlConnection destinationConnection =
new SqlConnection("Server=(localdb)\\mssqllocaldb;Database=HardwareDB;Trusted_Connection=True;"))
{
await destinationConnection.OpenAsync(cancellationToken);
// Set up the bulk copy object.
// Note that the column positions in the source
// data reader match the column positions in
// the destination table so there is no need to
// map columns.
using (SqlBulkCopy bulkCopy =
new SqlBulkCopy(destinationConnection))
{
bulkCopy.DestinationTableName =
"dbo.StagingProducts";
try
{
// Write from the source to the destination.
await bulkCopy.WriteToServerAsync(dbDataReader,cancellationToken);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
// Close the SqlDataReader. The SqlBulkCopy
// object is automatically closed at the end
// of the using block.
await dbDataReader.CloseAsync();
}
}
//####The following does not work yet.#####
//// Perform a final count on the destination
//// table to see how many rows were added.
//long countEnd = System.Convert.ToInt32(
// commandRowCount.ExecuteScalar());
//Console.WriteLine("Ending row count = {0}", countEnd);
//Console.WriteLine("{0} rows were added.", countEnd - countStart);
//Console.WriteLine("Press Enter to finish.");
//Console.ReadLine();
}
}
Once the data is inserted into the staging table, it should be transferred into a target tables in the database; specific columns in the staging tables should be mapped to a specific columns in the target tables.
Thus, the stored procedure should receive a list of column names
r/csharp • u/Darwin_Forex • 4d ago
Discussion Should I learn .NET MAUI if I already know C#?
Hi everyone!
I already know C# and I'm interested in developing mobile apps for Android and iOS. I'm considering learning .NET MAUI because it allows me to use C# instead of learning a completely new language like Dart for Flutter or Kotlin for Android.
For those who have experience with .NET MAUI, what has your experience been like? Is it a good option for someone who already knows C# and wants to develop apps for multiple platforms using a single codebase?
Would you recommend .NET MAUI, or would you suggest learning Flutter or Kotlin instead?
I'd appreciate your opinions and experiences. Thanks!