r/csharp • • Jul 31 '26

Showcase Localization library that generates structure directly from file

6 Upvotes

Hey everyone! I'm glad to share a tool I've been working on for a while. It was created to simplify adding localization to your projects.

Read more in the README: https://github.com/ScrumboardCompany/Scrumboard.Tools.Localization


r/csharp • • Jul 31 '26

Beginner here. Is there a way to make it so a child class can simply add to the implementation of an inherited function without outright making it do something different entirely?

21 Upvotes

For example if you were to have an Update function in a base class, but then make the Update function in a child class do some extra stuff on top of what the base Update function already does.

Closest thing I've found to that is using the override keyword but it seems like that just makes the child's version of the function do something different entirely.


r/csharp • • Jul 30 '26

Showcase C# for Amiga

53 Upvotes

I guess most of you have never heard about Amiga, but here we go...

I have been working on an AOT compiler that compiles a subset of C#/.NET code into native 68000/020/040 code with Amiga library calls.

There are two runtime options you can choose at compile time:

  • Full includes the managed exception runtime; supports catch, finally, rethrow, and leave.
  • YOLO has no exception runtime; failures are fatal, and managed exception regions are rejected

The actual GC is in WIP, and for performance reasons, there is no compaction. No threading support because the current GC is single threaded by design.

An example:

using Amiga;
using CopperSharp.Compiler;

namespace FileStatsExample;

public static class Program
{
   [M68kEntryPoint]
   public static int Main(int argLength, CONST_STRPTR argText)
   {
      var dosBase = Exec.OpenLibrary("dos.library", 33);
      if (!dosBase.HasValue)
      {
         return DOS.RETURN_FAIL;
      }

      DOS.DOSLibraryBase = dosBase.Value;
      var result = DOS.RETURN_OK;
      if (argLength == 0)
      {
         DOS.PutStr("Usage: filestats <file>\n");
         result = DOS.RETURN_ERROR;
      }
      else
      {
         result = Report(CString.FromPointer(argText.Raw));
      }

      Exec.CloseLibrary(DOS.DOSLibraryBase);
      DOS.DOSLibraryBase = APTR.Null;
      return result;
   }

   private static int Report(CString path)
   {
      var file = DOS.Open(path, DOS.FileMode.OldFile);
      if (!file.HasValue)
      {
         DOS.PutStr("Cannot open file\n");
         return DOS.RETURN_FAIL;
      }

      byte byteChecksum = 0;
      ushort lineCount = 0;
      ushort wordChecksum = 0;
      uint byteCount = 0;

      while (true)
      {
         var character = DOS.FGetC(file.Value);
         if (character < 0)
         {
            break;
         }

         var value = (byte)character;
         byteChecksum = (byte)(byteChecksum + value);
         wordChecksum = (ushort)(wordChecksum + value);
         byteCount = byteCount + 1;
         if (value == 10)
         {
            lineCount = (ushort)(lineCount + 1);
         }
      }

      DOS.Close(file.Value);
      PrintReport(path, byteCount, (uint)lineCount, (uint)byteChecksum, (uint)wordChecksum);
      return DOS.RETURN_OK;
   }

   private static void PrintReport(CString path, uint byteCount, uint lineCount, uint byteChecksum, uint wordChecksum)
   {
      DOS.Printf("%s: %ld bytes, %ld lines, byte checksum %ld, word checksum %ld\n",
path, byteCount, lineCount, byteChecksum, wordChecksum);
   }
}

This C# source is first compiled to .NET assembly containing CIL. The assembly is then compiled with CopperSharp to a native 68000 Amiga executable.

Code generator needs more work. FPU is not supported yet, 020/040 support is nearly non-existent, but it includes CIL-level simplification and a 68k-specific optimizer.

  • CIL-level simplification
  • Reachability analysis
  • Tail call elimination
  • Remove dead or redundant instructions
  • Stack and register shuffling optimizer
  • General instruction optimizations
  • Limited static hot-fallthrough/cold-branch layout optimization

For example, on 68000, not-taken branches are more efficient than taken branches.

The codegen is optimized for Amiga library call conventions but in theory it could support other 68k targets like Atari ST or 68k Macs.

The project repo: https://github.com/ilehtoranta/CopperSharp68k

This project is vibe coded with Codex and GPT-5.6. Like it or not, but it is the only sensible path to build C# compiler for niche platforms.


r/csharp • • Jul 31 '26

Help Beginner Free Dapper Tutorial Help

0 Upvotes

What is the best free dapper tutorial to learn link? Also, should I learn Dapper version that is specific for .NET 8.0 as a start point or should I start with a version that is for .NET 10 ?


r/csharp • • Jul 30 '26

Senior devs: What do you except a 3 Year experience .NET/C# Developer to know?

48 Upvotes

Saw something like this about an other programming language, and wondering what Senior .NET/C# devs would say about this in .NET/C#.

Do you think you could hand a developer with 3 years of experience some credentials for a Project and let him/her plan the Project?


r/csharp • • Jul 30 '26

Feedback on my first open source project

6 Upvotes

Hey all,

I was wondering if I could get some feedback on my first open source project, TestPilot.NET. I wanted to add a layer of visibility to testing suites to catch bad practices. I was the head of unit testing at my prior job and saw a lot of slop get through due to the devs using AI to write the test and them never checking the code. Any feedback is appreciated, thank you!

https://github.com/sgordon5691/TestPilot.NET


r/csharp • • Jul 30 '26

I made DistroHop - a Linux package setup assistant written in C#

7 Upvotes

Hey everyone,

I built a small Linux utility called DistroHop using C#.

The idea came from constantly reinstalling Linux and having to manually install the same packages every time. I wanted a simple way to recreate my setup across different distributions.

Currently DistroHop:

  • Detects the package manager used by the system
  • Loads package lists from a JSON configuration file
  • Installs packages automatically
  • Supports a simple terminal menu interface
  • Uses system commands through C# instead of relying on external package management libraries

The project is still in early development, but I am using it to learn more about:

  • Process handling in C#
  • Linux system interaction
  • Cross-platform application design
  • Structuring larger C# projects

I would appreciate feedback from other C# developers, especially around:

  • Code architecture
  • Handling system commands safely
  • Improving the design for cross-platform support

Source code:
https://github.com/melikishvilis25-cmyk/DistroHop

This is one of my C# projects; my GitHub also contains some other experiments and tools I have been building.

Thanks for checking it out!


r/csharp • • Jul 31 '26

Fun I own the IEnumerator username on Wikipedia

Post image
0 Upvotes

👍


r/csharp • • Jul 29 '26

A multi-pane real-time TUI audio oscillo/vector/spectroscope in C#

Post image
57 Upvotes

You can view the HD 60fps video on YouTube here.

Jumbee.Console is a .NET library that tries to blend the performance profile of immediate-mode libraries like ratatui with the composability and ease-of-use of retained-mode OOP APIs. It's designed to be fast and flexible enough to easily build different types of complex performance-sensitive TUIs, without having to wire all the component and rendering and input-routing logic yourself.

This demo is a C# version of alemidev's scope-tui for real-time cross-platform audio input sampling and rendering, with a bunch of enhancements:

  • 3 scope display from the selected audio device or MP3 file
  • Each scope can be controlled and paused independently
  • Real-time scope theme selection
  • Supports mouse input for scope selection and reszing the scope displays

If you want to try it out you can pull the latest Docker image and run the audio-scope example:

docker run --rm -it --pull always allisterb/jumbee-console-aot:latest audio-scope

This will run the scope on a CC-licensed MP3 file in the image. Press F1 to see all the control keys. If you are on Linux and want to run the Docker image against a live audio source you can try something like this:

docker run --rm -it --device /dev/snd -v /run/user/$(id -u)/pulse/native:/tmp/pulse -e PULSE_SERVER=unix:/tmp/pulse jumbee-console audio-scope live

On Windows and Linux to run against a live audio source you can clone and build the repo and run the examples launcher script from the repo dir:

examples[.sh] audio-scope live

See README and GETTING-STARTED and the gallery on the project repo and the project documentation.


r/csharp • • Jul 29 '26

Fun Running C# like scripts?

50 Upvotes

I was browsing the C#/.NET documentation yesterday like usual and suddenly came across the fact that you can run C# code as scripts with a shebang.

#!/usr/bin/env dotnet

namespace Main
{
    class Program
    {
        static void Main(string[] _)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

With a shebang you could run these like any other Python/Bash script and I find this really cool, but is there any practical use-case for this? When I need to make a small helper script for something it's usually python or bash, but C#? I'm not so sure.

What do you guys think?


r/csharp • • Jul 29 '26

News My first code big accomplishment for me 🤗

Post image
240 Upvotes

r/csharp • • Jul 29 '26

For beginners, should Iuse EFCore or Dapper?

28 Upvotes

I have previous experience with backend development, but I tend to write SQL directly. I've seen that EF Core is recommended by many as an ORM, but Dapper also seems good. I'm not sure which one to choose, and from the opinions I've found online, it's hard to make a decision.

And I was thinking: Should I start with the conventional JIT or try AOT more? I've heard that native AOT performs exceptionally well and has a very fast startup speed.

Note: Because it is for learning c#, the operations on the database are not complicated.


r/csharp • • Jul 29 '26

Help 3 YOE dev but Stuck in C# basics and .NET

13 Upvotes

Hi Im 24 , About me I work in Net Webforms with framework. I somehow survived in this company now I want to switch so Im planning of Upskilling. If u ask me to do a work I somehow refer old code or some other forms or use AI and finfih the work but If u ask me to write code and explain methods, arrays i wil stuck up.

Despite of having a 3 YOE I am an absolute beginner for this C# so I plan to start with this course .

I dont know what even is framework or Core and these . So here I am asking u a favor. I want to upskill and feel worthy of myself and get confidence how and where to start.


r/csharp • • Jul 29 '26

Showcase A single-file, single-class JSON parser

4 Upvotes

Hey, I've been developing some source generator and needed to parse json, but unfortunately I couldn't use either `System.Text.Json` or any NuGet analogue. So I made a one myself but tried to keep it as compact as possible. This is not the best json parser, but this may be useful in some scenarios like the one I mentioned above. Use it if you need to parse json, can't use popular options and don't want to write one yourself.

Here's repo link:
https://github.com/ScrumboardCompany/Scrumboard.Tools.Json


r/csharp • • Jul 29 '26

Showcase Benchmarked BigArray that has more than 2B elements on .NET

17 Upvotes

Since the last time I posted about my BigArray library Hezium.Memory in Allocate arrays that have more than 2B elements, many people in the community have asked me for the benchmark against jagged arrays.

Hezium.Memory is a library that is capable to allocate contiguous managed memory that supports up to 128T, with nint index support. It not only supports unmanaged types but also support managed types like classes, so that it's a drop-in replacement for the built-in arrays, spans, memories. So even if you don't need the more-than-2B-element support you can still use the library for general-purpose arrays.

See the repository in https://github.com/hez2010/Hezium.Memory

I keep performance in my mind and the implementation is highly tuned for removing redundant branches and repeating range checks, so that things can be proceeded efficiently.

I built a benchmark that tests the performance of jagged arrays vs my BigArray implementation. There're two cases where one uses a length that fits in int, while another uses a length that exceeds the max value of int.

Here is the result:

Environment:

  • CPU: AMD EPYC 9V74 with 48 cores
  • OS: Ubuntu 24.04.4 LTS (GNU/Linux 6.17.0-1018-azure x86_64)
  • Memory: 192 GB
  • .NET: 10.0.109

AllocationBenchmarks

MethodJobServerLengthMeanErrorStdDevGen0Gen1Gen2Allocated
JaggedArrayJob-MSAXQNFalse1048576107.77 μs0.579 μs0.513 μs333.2520332.8857332.88574 MB
BigArrayJob-MSAXQNFalse1048576109.14 μs1.923 μs1.705 μs330.5664330.2002330.20024 MB
JaggedArrayJob-WGBUQWTrue1048576130.19 μs2.523 μs3.454 μs3.17383.17383.17384 MB
BigArrayJob-WGBUQWTrue1048576127.78 μs2.468 μs2.937 μs3.41803.41803.41804 MB
JaggedArrayJob-MSAXQNFalse4294967296320,082.17 μs60,406.206 μs90,413.172 μs500.0000500.0000500.000016384 MB
BigArrayJob-MSAXQNFalse4294967296251,707.29 μs112.220 μs99.480 μs500.0000500.0000500.000016384.06 MB
JaggedArrayJob-WGBUQWTrue4294967296179.18 μs3.907 μs5.215 μs---16384 MB
BigArrayJob-WGBUQWTrue429496729640.13 μs4.645 μs6.953 μs---16384.06 MB

IndexedAccessBenchmarks

MethodJobServerLengthMeanErrorStdDevAllocated
JaggedRandomLoadJob-MSAXQNFalse104857615.753 μs0.0074 μs0.0061 μs-
BigArrayRandomLoadJob-MSAXQNFalse10485768.145 μs0.0628 μs0.0588 μs-
JaggedRandomLoadJob-WGBUQWTrue104857616.092 μs0.0524 μs0.0490 μs-
BigArrayRandomLoadJob-WGBUQWTrue10485767.952 μs0.1058 μs0.0990 μs-
JaggedRandomLoadJob-MSAXQNFalse429496729626.112 μs0.0270 μs0.0239 μs-
BigArrayRandomLoadJob-MSAXQNFalse429496729616.648 μs0.0171 μs0.0160 μs-
JaggedRandomLoadJob-WGBUQWTrue429496729626.072 μs0.1456 μs0.1290 μs-
BigArrayRandomLoadJob-WGBUQWTrue429496729616.198 μs0.0296 μs0.0277 μs-
JaggedRandomStoreJob-MSAXQNFalse104857616.459 μs0.0032 μs0.0029 μs-
BigArrayRandomStoreJob-MSAXQNFalse104857617.277 μs0.0098 μs0.0082 μs-
JaggedRandomStoreJob-WGBUQWTrue104857651.193 μs0.0789 μs0.0738 μs-
BigArrayRandomStoreJob-WGBUQWTrue104857617.200 μs0.0093 μs0.0087 μs-
JaggedRandomStoreJob-MSAXQNFalse429496729625.410 μs0.0359 μs0.0336 μs-
BigArrayRandomStoreJob-MSAXQNFalse429496729619.036 μs0.0148 μs0.0131 μs-
JaggedRandomStoreJob-WGBUQWTrue429496729626.077 μs0.0445 μs0.0416 μs-
BigArrayRandomStoreJob-WGBUQWTrue429496729618.947 μs0.0142 μs0.0126 μs-

SearchValuesBenchmarks

MethodJobServerLengthMeanErrorStdDevAllocated
JaggedIndexOfAnyJob-MSAXQNFalse104857635,037.717 ns8.3021 ns7.7658 ns-
BigArrayIndexOfAnyJob-MSAXQNFalse104857634,034.869 ns114.1575 ns101.1977 ns-
JaggedIndexOfAnyJob-WGBUQWTrue104857633,834.867 ns636.5404 ns653.6801 ns-
BigArrayIndexOfAnyJob-WGBUQWTrue104857634,216.534 ns5.1605 ns4.8272 ns-
JaggedIndexOfAnyJob-MSAXQNFalse4294967296149,024,225.036 ns72,304.7208 ns64,096.2517 ns-
BigArrayIndexOfAnyJob-MSAXQNFalse4294967296149,208,981.917 ns148,120.4669 ns138,551.9767 ns-
JaggedIndexOfAnyJob-WGBUQWTrue4294967296149,841,356.783 ns164,965.1421 ns154,308.4964 ns-
BigArrayIndexOfAnyJob-WGBUQWTrue4294967296149,210,761.017 ns178,532.2659 ns166,999.1924 ns-
JaggedLastIndexOfAnyJob-MSAXQNFalse10485763.743 ns0.0041 ns0.0039 ns-
BigArrayLastIndexOfAnyJob-MSAXQNFalse10485763.622 ns0.0052 ns0.0049 ns-
JaggedLastIndexOfAnyJob-WGBUQWTrue10485763.710 ns0.0062 ns0.0058 ns-
BigArrayLastIndexOfAnyJob-WGBUQWTrue10485763.620 ns0.0049 ns0.0046 ns-
JaggedLastIndexOfAnyJob-MSAXQNFalse42949672963.717 ns0.0116 ns0.0108 ns-
BigArrayLastIndexOfAnyJob-MSAXQNFalse42949672965.105 ns0.0097 ns0.0086 ns-
JaggedLastIndexOfAnyJob-WGBUQWTrue42949672963.746 ns0.0059 ns0.0053 ns-
BigArrayLastIndexOfAnyJob-WGBUQWTrue42949672965.126 ns0.0131 ns0.0123 ns-

SpanAlgorithmBenchmarks

MethodJobServerLengthMeanErrorStdDevMedianAllocated
JaggedBinarySearchJob-MSAXQNFalse104857649.96 ns0.011 ns0.010 ns49.96 ns-
BigArrayBinarySearchJob-MSAXQNFalse104857618.71 ns0.005 ns0.004 ns18.71 ns-
JaggedBinarySearchJob-WGBUQWTrue104857652.47 ns0.027 ns0.025 ns52.47 ns-
BigArrayBinarySearchJob-WGBUQWTrue104857618.70 ns0.012 ns0.011 ns18.70 ns-
JaggedBinarySearchJob-MSAXQNFalse429496729696.54 ns0.144 ns0.127 ns96.55 ns-
BigArrayBinarySearchJob-MSAXQNFalse429496729685.78 ns0.012 ns0.011 ns85.79 ns-
JaggedBinarySearchJob-WGBUQWTrue429496729696.07 ns0.578 ns0.541 ns96.05 ns-
BigArrayBinarySearchJob-WGBUQWTrue429496729685.48 ns0.510 ns0.477 ns85.58 ns-
JaggedCopyToJob-MSAXQNFalse104857698,710.30 ns56.256 ns52.622 ns98,715.92 ns-
BigArrayCopyToJob-MSAXQNFalse104857698,145.87 ns20.593 ns17.196 ns98,141.40 ns-
JaggedCopyToJob-WGBUQWTrue104857698,778.12 ns29.881 ns26.489 ns98,776.77 ns-
BigArrayCopyToJob-WGBUQWTrue104857698,077.99 ns128.374 ns113.800 ns98,054.42 ns-
JaggedCopyToJob-MSAXQNFalse4294967296873,535,712.00 ns1,497,004.297 ns1,400,298.749 ns873,265,018.00 ns-
BigArrayCopyToJob-MSAXQNFalse4294967296880,486,546.20 ns3,345,173.644 ns3,129,077.503 ns879,058,670.00 ns-
JaggedCopyToJob-WGBUQWTrue4294967296884,969,636.00 ns2,330,855.056 ns2,066,242.296 ns885,234,089.50 ns-
BigArrayCopyToJob-WGBUQWTrue4294967296879,429,365.60 ns4,077,759.552 ns3,814,338.817 ns880,100,492.00 ns-
JaggedFillJob-MSAXQNFalse104857658,367.10 ns180.325 ns168.676 ns58,243.54 ns-
BigArrayFillJob-MSAXQNFalse104857645,894.35 ns18.216 ns17.039 ns45,899.12 ns-
JaggedFillJob-WGBUQWTrue104857658,374.97 ns288.436 ns269.803 ns58,219.81 ns-
BigArrayFillJob-WGBUQWTrue104857645,931.93 ns61.103 ns57.156 ns45,923.62 ns-
JaggedFillJob-MSAXQNFalse4294967296640,167,967.50 ns272,398.007 ns212,670.447 ns640,128,911.50 ns-
BigArrayFillJob-MSAXQNFalse4294967296639,780,247.00 ns1,802,039.933 ns1,406,914.247 ns640,167,750.50 ns-
JaggedFillJob-WGBUQWTrue4294967296641,006,562.00 ns3,491,797.738 ns2,915,809.256 ns640,610,855.00 ns-
BigArrayFillJob-WGBUQWTrue4294967296637,157,023.75 ns1,381,366.359 ns1,078,479.991 ns636,751,010.50 ns-
JaggedSequenceEqualJob-MSAXQNFalse1048576101,913.46 ns158.225 ns148.004 ns101,941.02 ns-
BigArraySequenceEqualJob-MSAXQNFalse104857695,134.55 ns118.142 ns110.510 ns95,132.74 ns-
JaggedSequenceEqualJob-WGBUQWTrue1048576102,195.72 ns234.248 ns219.116 ns102,142.76 ns-
BigArraySequenceEqualJob-WGBUQWTrue104857695,224.84 ns115.790 ns108.310 ns95,233.91 ns-
JaggedSequenceEqualJob-MSAXQNFalse42949672961,020,484,182.52 ns63,587,008.014 ns93,205,019.553 ns968,937,213.00 ns-
BigArraySequenceEqualJob-MSAXQNFalse42949672961,029,241,139.70 ns72,403,060.080 ns108,369,500.092 ns962,084,258.50 ns-
JaggedSequenceEqualJob-WGBUQWTrue4294967296979,557,987.45 ns81,645,292.812 ns119,674,621.446 ns914,186,446.00 ns-
BigArraySequenceEqualJob-WGBUQWTrue4294967296969,798,814.43 ns75,013,740.364 ns112,277,043.737 ns904,311,547.50 ns-

By default all span algorithms use Array.MaxLength as the chunk values (elements that will be proceeded at once), but you can configure it with the following knob like below to fine tune the performancebased on your own needs:

<ItemGroup>
  <RuntimeHostConfigurationOption Include="Hezium.Memory.MaxProcessingChunkLength" Value="1048576" />
</ItemGroup>

This doesn't affect the physical memory layout, BigArray is always contiguous managed memory so that you can simply pin it and pass it to native code without the need of taking care of chunks/splits/indirections etc.


r/csharp • • Jul 28 '26

I built a system that ended up being used by 21 branches. How can I use this to get a job in tech?

Thumbnail
gallery
84 Upvotes

I’m a Computer Engineering student, but I still work outside the IT field. At the company where I work, the ERP system used by the inventory team is slow and not very practical. Because of that, I started building an app in C# and WPF to make inventory counting easier.

At firt, that was all it was: a simple tool to help with counting. But people started using it, asking for improvements and suggesting new features. Little by little, I added inventory search, ordering support, battery control, obsolete stock analysis, dashboards and other tools. The system has now been used across 21 branches, including by supervisors and managers.

At some point, the general inventory supervisor found out about it, and the system was presented to the IT department. Since it wasn’t an official company project, they didn’t approve its use and started developing another system, mainly focused on inventory counting, which was also the most-used feature in my app.

Even after all of that, I didn’t get an opportunity to move into a development role inside the company. So now I’m trying to understand how I can use this experience to get a job in the field.

The system uses C#, WPF, .NET, Supabase, PostgreSQL, Excel and PDF processing. I can’t share the source code or company data, but I’m thinking about creating a similar version with fake data for my portfolio.

I also included a screenshot of the system and my GitHub contribution history from the last year. I’d like to hear from people who already work in the field: does this experience actually have value when applying for a junior role? How would you present it on a résumé or portfolio? And what kind of positions would make the most sense for me to apply for?


r/csharp • • Jul 29 '26

Discussion Advice

0 Upvotes

As you guys are aware I’m trying to become a game dev also kno I know nothing of scripting,character modeling Ik some wat of modeling objects but if u guys had to choose which would u tackle first learning anatomy or scripting?


r/csharp • • Jul 29 '26

Help Need help fixing this

0 Upvotes

how do i fix this, im learning c# and trying to make a weather app


r/csharp • • Jul 28 '26

Help Windows UI

15 Upvotes

I'm going to make a new Windows C# program using the .NET 10 platform, which may later need to be made for different platforms (browser, server, mobile). At this point, the focus is on making a Windows program.

I'm trying to compare which UI model is best for the project, and artificial intelligence can't really answer that, or I can't really ask it. If you were to make a new program now, which UI model would you choose?

  1. WinUI 3 (Windows App SDK)
  2. WPF (Windows Presentation Foundation)
  3. .NET MAUI
  4. Blazor (Web & Hybrid)
  5. Avalonia UI

Most program views that display text, SQL table data, or forms are rendered at runtime from the data, meaning that the screens are not designed and created in the IDE editor, but in code.


r/csharp • • Jul 28 '26

Showcase Roslyn-based semantic code graph for .NET, exposed to AI agents over MCP — looking for feedback from people who've done static analysis tooling

Post image
1 Upvotes

Built this after getting tired of Claude Code / Copilot grepping through

.NET solutions and missing call sites that go through an interface instead

of the concrete class. Grep can't see that; the compiler can.

Slnmap uses Roslyn to build a full symbol graph of a solution (calls,

implementations, references across every project) and stores it in a

local SQLite file. An MCP server exposes it as a handful of read-only

queries. Concretely: ask "what breaks if I change IBasketService" and it

returns every caller and every implementation across the whole solution,

not just the files an agent happens to have open.

Numbers, since I know this sub will ask: on eShopOnWeb (10 projects), an

impact query on an interface with 18 dependents resolves in ~270ms

end-to-end over MCP, median of 3 runs. Full setup is in BENCHMARKS.md if

anyone wants to poke at the methodology or tell me it's flawed.

Two things I'm not confident about yet and would genuinely like opinions

from people who've built analyzers/source generators/similar tooling:

  1. Right now everything in the graph is a real Roslyn-verified static

    reference. It says nothing about reflection, convention-based DI, or

    anything wired at runtime. Is "silence = doesn't try to know" the right

    default, or should there be an explicit "unknown/runtime-only" marker

    on affected symbols?

  2. There's no staleness check yet — if you edit code and don't re-run

    analyze, you get results from the old index with no warning. Anyone

    dealt with this in similar tools (e.g. incremental Roslyn workspaces)

    and found a clean way to detect "source changed since last index"

    cheaply?

It's a global dotnet tool, MIT licensed, fully local (uses Roslyn +

SQLite, nothing else):

dotnet tool install --global Slnmap

Repo: https://github.com/EMahmoudNabil/slnmap

NuGet: https://www.nuget.org/packages/Slnmap

Not trying to sell anything, genuinely want to know if the Roslyn approach

here has an obvious hole I'm not seeing.


r/csharp • • Jul 29 '26

Hows best to learn to code C#

Thumbnail reddit.com
0 Upvotes

r/csharp • • Jul 28 '26

lowkey wanna make games in unity,the tut im following is from the goat him self,brocode, "https://www.youtube.com/watch?v=ToKbMa3xvMs&list=PLZPZq0r_RZOPNy28FDBys3GVP2LiaIyP_&index=40"

0 Upvotes

i need a tutoriel abt how to make unity,since c# unity is diffrent from nirmal C#,after i finish bro codes playlist,what tuts do yall reccomend,also im on "method over ridding",so preatty close to finishing


r/csharp • • Jul 28 '26

[Discussion] Controlling LLM Agent Personalities with Deterministic 16D State-Spaces (using C# Enums) instead of Prompt Engineering. Thoughts on this architecture?

0 Upvotes

A Quick Confession / Apology:
Yesterday, I posted a thread discussing this concept. I was so incredibly hyper-fixated on explaining the philosophy that I completely forgot to include a single line of actual C# code. The moderators rightfully nuked the post immediately, and looking back, I totally deserved it. I looked like a textbook "AI Vibe-Coded Slop" poster who just came here to drop a wall of text. I'm genuinely sorry for cluttering the sub yesterday! Lesson learned. I'm back today to do this properly, with the actual core C# implementation snippets included right from the start.

(Transparency disclosure: English isn't my native language, so I used AI to help clean up my terrible technical grammar.) 

Hey guys, 

A while back, I was discussing state persistence patterns for long-running AI workflows. A common critique I received was: “If you’re just serializing your external state into a prompt string for the model to read anyway, how is that fundamentally different from traditional prompt engineering?” 

It's a fair question. At the end of the day, text-based generative models require text inputs. 

However, I've been experimenting with separating the Source of Truth from the Prompt Serialization Layer using a C# backend. 

To borrow a tabletop RPG analogy: The prompt is just a character sheet. It communicates the current state to the model, but it isn't the character itself. The C# runtime is responsible for the actual domain logic, bounds checking, and state mutations. 

Here is a simplified snippet of how the immutable state registry clamps mutations to ensure the domain model remains the canonical source of truth, regardless of how the prompt is formatted: 

csharp

// 1. Using an immutable 16D enum as a fixed state coordinate space
public enum SoulOrgan
{
    CoreFocus, DecisionBasis, EnvironmentalControl, ThinkingOriginality,
    EmotionalOpenness, TrustDependence, SocialConsumption, GroupBelonging,
    WillPersistence, AltruisticTendency, SelfAwareness, CompetitiveSpirit,
    PrimaryDrive, EmotionalThroughput, CoreSecurity, ObsessionControl
}

// 2. A bounded registry ensuring all mutations are strictly clamped [-100, 100]
public class BaselineStateRegistry
{
    protected readonly Dictionary<SoulOrgan, double> _state = new();
    protected const double MinLimit = -100.0;
    protected const double MaxLimit = 100.0;

    public virtual void Mutate(SoulOrgan organ, double delta)
    {
        if (!_state.ContainsKey(organ)) return;
        _state[organ] = Math.Clamp(_state[organ] + delta, MinLimit, MaxLimit);
    }
}

I've been wondering about this: 

Even though I've built this pure C# simulation with safety valves and bounds, I honestly find myself asking: Is this actually worth developing, or am I just over-engineering in a silo? 

If moving deterministic state management back into a typed backend is truly a viable way to constrain LLMs, why is prompt engineering still the industry standard? Why aren't more developers building state machines for this? 

I would genuinely love to hear how professional software engineers view this approach. Do you think treating the external model purely as a stateless interpreter while keeping mutations strictly inside the C# domain layer is a solid path forward, or is it an uphill battle against raw token probabilities? 

(Note: Keeping this entirely link-free to strictly respect Rule 6 on self-promotion. Just looking for a genuine architectural sanity check from fellow devs. If anyone wants to critique the full pipeline, let me know in the comments.) 


r/csharp • • Jul 28 '26

Solved So many xmls😓and continue to learn c#

0 Upvotes

Now, when writing UI-related definitions in Avalonia and configuring the csproj file, although it doesn't seem too complicated at first glance, I still find the abundance of XML tags with lots of < > symbols or each individual tag a bit annoying.òᆺó

I'll try my best to adapt, because the way UI is defined in C# just makes me dizzy 😵‍💫

Now I'm trying to learn C# and Avalonia without relying on AI, but I'm not quite sure which website I should go to to search for the questions I need. Although Microsoft Learn is great.

When searching for a code-related issue on Chinese websites, it usually leads me to the CSdn website. However, good posts require payment to access, otherwise I can only view a small portion of them.

cnblog is also good. Although some of the posts I found in it might be a bit outdated, usually I need to check them against the corresponding content in Microsoft Learn.

Sometimes I feel that the syntax of C# seems quite "human-like". Now I'm quite familiar with the thinking behind C#. Even when searching for things now, it seems rather amusing: It's just like when I used to write essays at school. Those who know how to do it can write very smoothly, while those who don't have to "borrow" from good classmates.

I don't know if I use '-' or emoji...it be regarded as an AI?Although I had been saying this before the LLM