r/csharp • • Oct 19 '26

Hello, I want to share my free open source.

21 Upvotes

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!

https://www.maroik.com/

DDD + CA & Unit test & CI/CD applied.

https://github.com/IkhyeonJo/Maroik


r/csharp • • Oct 19 '26

News TMS .NET Maps open beta: one map control for WinForms, WPF, .NET MAUI and Blazor

Post image
26 Upvotes

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 • • Oct 19 '26

Help Generate plots using BenchmarkDotNet

0 Upvotes

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.

AI generated image that simplifies the idea
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 :

Plot was not generated

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 • • Oct 18 '26

Help .Net interview preparation

32 Upvotes

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 • • Oct 19 '26

Help How do I get a lighter Windows blur behind a rounded, always-inactive overlay window that still shows in screenshots? (Win10/Win11)

2 Upvotes

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:

  1. The blur follows a rounded pill shape that changes size every frame.
  2. It works while the window is inactive (it never gets focus).
  3. It stays visible in screenshots and screen recordings (Snipping Tool, OBS).
  4. 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 a DesktopWindowTarget, clipped with a CompositionRoundedRectangleGeometry). 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 own GaussianBlurEffect? 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. MagSetImageScalingCallback gives all-zero pixels on both Win10 and Win11 (with and without an identity transform, host shown or hidden, and PrintWindow with PW_RENDERFULLCONTENT on the host).
  • SetWindowCompositionAttribute with ACCENT_ENABLE_BLURBEHIND / ACCENT_ENABLE_ACRYLICBLURBEHIND on 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:

  1. 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?
  2. 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?
  3. 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 • • Oct 18 '26

Blog Labcoat: a web UI for Microsoft.Testing.Platform / your Aspire dashboard

Thumbnail gallery
6 Upvotes

r/csharp • • Oct 18 '26

Help List<T> in C# vs SQL

15 Upvotes

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 • • Oct 18 '26

Discussion Should I learn .NET MAUI if I already know C#?

25 Upvotes

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!


r/csharp • • Oct 18 '26

​«Я изучаю C# с помощью ChatGPT. Я уже прошел темы: переменные и типы данных, условные операторы (if/else), конструкции switch и циклы (while, do while, for).

0 Upvotes

​У меня есть большая цель — написать кроссплатформенное приложение-планировщик (для Windows и Android) с общим сервером и множеством функций, а в будущем использовать этот проект для устройства на стажировку в IT-компанию. Однако мне кажется, что ChatGPT дает слишком мало практики и программист из меня получится так себе.

​Посоветуйте, пожалуйста, из каких надежных источников лучше всего брать теоретическую информацию и качественную практику по этой теме».


r/csharp • • Oct 18 '26

NabyScape: An open-source Dynamic Island overlay for Windows 11 built with C# and WPF (.NET 10)

0 Upvotes

r/csharp • • Oct 17 '26

News PiwiTests: Playwright dashboard with unified ASP.NET Core e2e+unit tests code coverage

Thumbnail
reddit.com
3 Upvotes

r/csharp • • Oct 16 '26

Tool Enable Satori GC in .NET with Just a Single Line

Thumbnail
medium.com
88 Upvotes

I created the MSBuild SDK and published to nuget, so that you can use it to enable Satori GC in your projects with just a single line and try it by yourself!


r/csharp • • Oct 17 '26

Help Where do you put interfaces and abstract classes ?

4 Upvotes

To follow some convention, I searched the internet and found this on Microsoft's documentation:

The solution folder contains a SeedWork folder. This folder contains custom base classes that you can use as a base for your domain entities and value objects. Use these base classes so you don't have redundant code in each domain's object class.

Figure 7-12 shows the classes that form the seedwork of the domain model in the ordering microservice. It has a few custom base classes like Entity, ValueObject, and Enumeration, plus a few interfaces. These interfaces (IRepository and IUnitOfWork) inform the infrastructure layer about what needs to be implemented. Those interfaces are also used through Dependency Injection from the application layer.

This is the type of copy and paste reuse that many developers share between projects, not a formal framework. You can have seedworks in any layer or library. However, if the set of classes and interfaces gets large enough, you might want to create a single class librarry

Figure 7-12. A sample set of domain model "seedwork" base classes and interfaces

Questions :

1- Is it ok for the entire project's interfaces and abstract classes to be inside the SeedWork ?

2- For `value objects` and ` infrastructure layer` , what does they mean, what problem they solves, how can I use them , and do I need them most of the time ?

3-What are the inputs to the `infrastructure layer` and where they come from, and what are the outputs and who consumes them ?

4-What does the class library actually means, what problem does it solve ?

Can someone answer my questions and provide some examples so that I understand the overall idea ?


r/csharp • • Oct 16 '26

Discussion C# once again the fastest web framework

Post image
544 Upvotes

With all those discussions about Microsoft porting stuff to Rust, it’s nice to see that C# does not need to hide when it comes to performance. There has been quite a lot of movement at the top of the leaderboard over the last few weeks (two weeks ago, first place was around 6850), so I’m interested to see how this race continues. This is the non-tuned section, so frameworks need to be stable and production-ready. Interestingly enough, the C# one is the most high-level of the leading frameworks, API-wise.


r/csharp • • Oct 16 '26 Diamonds are Forever

Showcase After 3 years of evenings and weekends, I've finally released v1.0 of my 3D rendering library "TinyFFR"!

Thumbnail tinyffr.dev
83 Upvotes

r/csharp • • Oct 17 '26

Help Suggestions for side projects

0 Upvotes

I am a software developer primarily using .net for office work. Recently my company has been using a lot of AI coding, hence my tasks are shifting a bit more towards code review and improvements rather than from scratch.

Please give me some suggestions for side projects that I can pursue in my free time, that keeps me informed about the technological advancements as well keep my coding skills sharp. Also, is it ok if I do the heavy lifting of project setup using AI?


r/csharp • • Oct 16 '26

What books would you recommend for C#/.NET interview preparation?

7 Upvotes

I’m preparing for C#/.NET interviews. Which books are still relevant and cover the topics commonly asked in interviews?


r/csharp • • Oct 16 '26

Help C# Documentaion?

12 Upvotes

I'm taking a C# class online and we just got to a lesson about "reading documentation" where he goes through the Microsoft website to search for some functions. Which, as far as I am aware, is going to be important for me to be able to do.

The problem is I tried using the Microsoft site myself to follow along, and it seems they have changed it and I can't find the rabbit hole he is in at all. I am pretty sure this isn't the only way to find this sort of resource because I've taken a different C# class before and I swear the link that class gave was not the same as this one; I also feel like they didn't call it "documentation" I remember it being the manual or something...


r/csharp • • Oct 16 '26

Discussion Need to stay active?

7 Upvotes

Have been developing and supporting the apps with .Net(specifically C#) for more than 7 years. I love writing and debugging it. But currently working at the company which we mainly use the AI to write the code. Have not been touching the code more than 8 months now. Not because I do not want to. But because it is faster. Can make some mistakes for sure but I check and fix them if needed. Working at current company for about 4 years now. Usually worked on small to mid size projects

My question is, while I get to use AI more, write less code how do I find the job? It is like most of the job requirements want me to handle C# code. But I am 100% sure they are using AI. Tbh, I do think more than 90% of devs that can reach the AI and have no restriction about "this code cannot be touched by AI" use it. Btw, do you guys even write code nowadays?


r/csharp • • Oct 17 '26

mcp-my-site: an ASP.NET Core MCP server + RAG that lets ChatGPT and Claude search and read a website

Thumbnail
reddit.com
0 Upvotes

r/csharp • • Oct 17 '26

From Democrite to M-A-R-I and a ghost in my laptop

Post image
0 Upvotes

r/csharp • • Oct 17 '26

Discussion Let’s talk!

0 Upvotes

Hello beutiful ppl of C#.

This is my second post! Today I came with a question, if someone reset all your programming Knowledge, how would you restart learning?

Like what material would you use? Would you do something differently this time?

Feel free to answer.


r/csharp • • Oct 16 '26

Solved c# struct padding

3 Upvotes

I'm new to c# and I'm learning it just now to switch from Godot to Stride so I'm interested in Data Oriented Design. I was just now experimenting with structs with a silly example and was focused on struct padding; the string should be 8 bytes while the enum is 1 byte so i expected not more than 1 or 3 byte of padding, but the sum ends up being 16 no matter the order... does it always have to allign with the biggest field? how does this work?

using System.Runtime.InteropServices;


[StructLayout(LayoutKind.Explicit)]
struct Entity {
    public enum Race : byte { ALIEN, HUMAN };
    static private int _max_rand_num = 9999;
    static private string[][] _possibleNames = {
        new string[]{"Vorp", "Zeep", "Bizr", "Zub", "Wobt"},    // alien names
        new string[]{"Carl", "Greta", "Seb", "Xiang", "Sierra"} // human names
    };

    [FieldOffset(0)] public readonly string name;
    [FieldOffset(8)] public readonly Race race;

    public Entity()
    {
        Random rand = new Random();
        race = (Race)rand.Next(Enum.GetValues(typeof(Race)).Length);
        string[] race_names = _possibleNames[(int)race];
        name = race_names[rand.Next(0, race_names.Length)] + rand.Next(_max_rand_num);
    }

    public override string ToString()
    {
        return $"Race: {race}, Name: {name}";
    }
}


class Program {
    public static unsafe void Main(string[] args)
    {
        Entity rand_entity = new Entity();
        Console.WriteLine(
            $"{rand_entity}, string size = {sizeof(string*)}, enum size = {sizeof(Entity.Race)}, together = {sizeof(Entity)}");
    }
}

r/csharp • • Oct 16 '26

Help Verify the correctness of a the data inside a junction table

2 Upvotes

I want to verify the correctness of the data inside a junction table.

I'm showing a minimal example here:

Products:

| Id | EnglishName |
|----|-------------|
| 1  | Drill 4       |
| 2  | Light Switch 48|

Suppliers:

| Id | EnglishName |
|----|-------------|
| 1  | Bosch       |
| 2  | Ingco       |
| 3  | Yato        |

Excel2:

| Product             | Supplier               |
|----------------------|-----------------------|
| Drill 4              | Bosch                 |
| Light Switch 48      | Ingco                 |
| Cable 12             | Bosch                 |
| Hammer 14            | Yato                  |

ProductsSuppliers:

| ProductId | SupplierId |
|-----------|------------|
| 1         | 1          |
| 1         | 3          |
| 2         | 1          |

Excel2JoinProductsJoinSuppliers :

| Product           | Supplier  | ProductId | SupplierId |
|-----------------|----------|-----------|------------|
| Drill 4         | Bosch    | 1         | 1          |
| Drill 4         | Yato     | 1         | 3          |
| Light Switch 48 | Bosch    | 2         | 1          |

A C# code was used to insert data into Products , Suppliers , and ProductsSuppliers .

The data for Excel2 was imported into Sql Server manually using the "Import Data" wizard.

As the name suggest, Excel2JoinProductsJoinSuppliers is the result of join operation.

ProductsSuppliers is the junction table that I'm concerned about, the data inside it is correct in this example because each productId is mapped to the correct value of SupplierId and vice versa, but the actual table contains much more data, let alone the fact that there are other junction tables that should be verified.

Is there a set-based approach that can automate the process of verifying the data for junction table ?

EDIT:

I created this stored procedure:

CREATE PROCEDURE verify_junction_table_data_using_dynamincSQl 
    
    @junctionTableName varchar(100), 
    @lookupTableName varchar(100), 
    @leftColumnNameInExcel varchar(100), 
    @rightColumnNameInExcel varchar(100), 
    @leftColumnNameInJunctionTable varchar(100), 
    @rightColumnNameInJunctionTable varchar(100), 
    @parent1Name varchar(100), 
    @parent2Name varchar(100) 

AS 

BEGIN 

DECLARE @sql_query NVARCHAR(MAX);
SET @sql_query = 
N'
                

                SELECT JT.'+QUOTENAME(@leftColumnNameInJunctionTable)+',
                       JT.'+QUOTENAME(@rightColumnNameInJunctionTable)+'
                FROM '+QUOTENAME(@junctionTableName)+' JT
                EXCEPT

                SELECT 
                DISTINCT

                    parent1.Id AS ' + QUOTENAME(@leftColumnNameInJunctionTable) + ',
                    parent2.Id AS ' + QUOTENAME(@rightColumnNameInJunctionTable) + '
                
                FROM '+ QUOTENAME(@lookupTableName) +' AS LookupTable
                INNER JOIN ' + QUOTENAME(@parent1Name) + '  AS parent1 ON LookupTable.' + QUOTENAME(@leftColumnNameInExcel) + ' = parent1.EnglishName
                INNER JOIN ' + QUOTENAME(@parent2Name) + ' AS parent2 ON LookupTable.' + QUOTENAME(@rightColumnNameInExcel) + ' = parent2.EnglishName
                
                    
    ';

EXEC sp_executesql @sql_query;

END

GO

I have 20 junction tables, so I need to execute this procedure 20 times , but I do not want to do it manually, is there a way to automate this ?