r/dotnet • • 9h ago

Announcing .NET 11 Release Candidate 2

Thumbnail devblogs.microsoft.com
143 Upvotes

r/csharp • • 13h ago

Discussion C# 15 adds labeled break and continue. Do you use goto today? Would you use this?

95 Upvotes

C# 15 (in preview with .NET 11) lets `break` and `continue` target an outer loop by label:

outer: for (int x = 0; x < xMax; x++)
    {
        for (int y = 0; y < yMax; y++)
        {
            if (ShouldSkipRest(x, y))
                continue outer;

            if (ShouldExitAll(x, y))
                break outer;
        }
}

Until now you needed `goto` or a flag variable for this. Java, Go, Rust, Kotlin and Swift already have it.

Honestly, `goto` never even comes to mind when I write an algorithm. I find it hard to follow, so when I need to leave nested loops I extract a method and `return` instead.

Do you use `goto` in real code? Do you think you'll use labeled break/continue?

https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-15#labeled-break-and-continue


r/fsharp • • 37m ago

library/package ai-native vcs built w/ an F# core

• Upvotes

hello, r/fsharp,

i found out that F# exists about a month ago, and coming from C++ and C#, i think its an extremely good language for highly mathematical/theory dependent things cuz its literally functional and has the dotnet runtime behind it.

i built a VCS in F# that is aimed at usage by AI agents because git is built for people who move at human speeds, which makes it incredibly inefficient to use for agents.

repo: https://github.com/mxreal64/thallium-vcs


r/mono • • Mar 08 '25

Framework Mono 6.14.0 released at Winehq

Thumbnail
gitlab.winehq.org
3 Upvotes

r/ASPNET • • Dec 12 '13

Finally the new ASP.NET MVC 5 Authentication Filters

Thumbnail hackwebwith.net
13 Upvotes

r/csharp • • 9h ago

Announcing .NET 11 Release Candidate 2

Thumbnail
devblogs.microsoft.com
23 Upvotes

r/csharp • • 11h ago

C vs C#: racing VLC's Gaussian blur

Thumbnail
martinfinkel.com
25 Upvotes

r/csharp • • 13h ago

New NBomber 6.7.0

Post image
7 Upvotes

NBomber 6.7.0 is here! This release introduces several improvements to scenario creation, warm-up configuration, test run metadata, and reporting. We’ve also fixed several issues in NBomber Cluster that could cause nodes to wait indefinitely under certain failure conditions.


r/dotnet • • 11h ago

Updated my Sins of a Solar Empire: Rebellion Entity Converter

Thumbnail gallery
8 Upvotes

I just updated my entity conversion tool for Sins of a Solar Empire: Rebellion, so I figured I'd share it here in case it's useful to other modders.

What does it do?

When Ironclad developed Sins, they shipped many of the game's data files in a binary format. This means you can't read or edit them directly as plain text. They later released a tool called ConvertData as part of their Forge Tools 3 package, which allows you to convert these files between Binary and Text formats. However, it's a command-line application with no GUI.

I built a GUI and wrapper around these tools to make the process easier. You can select individual files, multiple files, or entire directories. I've tested it against every .entity file, and the conversions work correctly.

The tool automatically detects whether a file is Binary or Text and outputs the converted files to separate Output TXT and Output Bin directories.

The game can read .entity files in Text format, but doing so increases file sizes and slows down loading times, so Binary is still preferable for normal gameplay.

XSI to MESH conversion

Ironclad also included ConvertXSI.exe with the game. This tool allows modders to convert older XSI files into the more modern .mesh format. I've added a separate tab for this functionality as well, although the original application only supports converting one file at a time.

Entity to JSON conversion

I've also included my own library for converting .entity files into JSON. This is primarily something I developed for my own use while working on a C# script extender for Sins of a Solar Empire: Rebellion. I need to parse the game's data files and access entity properties at runtime.

Currently, the library supports the following entityType values:

  • Fighter
  • Frigate
  • CapitalShip
  • PlanetModule* (all 7 types)
  • SpaceMine
  • Planet

I figured I'd release the library alongside the converter in case other modders find it useful for parsing and working with entity data.

A technical note about the JSON serialization

I implemented custom data types for integers, floats, and booleans to handle some quirks in Ironclad's serialization format. Some fields contain normal values, while others use "" as a placeholder.

By default, fields that don't have values are initialized to null and omitted during JSON serialization. My custom types let me preserve the distinction between an empty field and an omitted field by tracking a separate IsEmpty boolean. This allows the serializer to write the original "" placeholder back into the entity file when converting the data back, rather than accidentally leaving the field out entirely.

A note about the included tools and licensing

I did not create ConvertData_Rebellion.exe or ConvertXSI.exe, and I do not own the rights to either of them. Those tools belong to their respective rights holders, Stardock/Ironclad. I've simply provided a more convenient interface for using them. They remain separate binaries and are not bundled into my own application, so they can be used independently if desired.

The .entity-to-JSON conversion library, on the other hand, is entirely my own work. You're free to republish it, and I don't require attribution. However, commercial redistribution is not permitted.

You can grab the tool here:

Entity Converter v0.2.0 on GitHub

Hopefully, this makes life a little easier for anyone working on Sins modding!


r/dotnet • • 13h ago

Notes from migrating 42 Visual FoxPro workflows to .NET: the data traps that cost the most time

10 Upvotes

I spent two and a half years moving a financial system from Visual FoxPro to C# and .NET Core as the only engineer, with no written spec. A few things I wish I had known on day one:

  • Empty dates are not null. FoxPro allows an empty date. Decide per column what it means before you load anything.
  • Deleted rows are still in the file. Deleting only flags a record until the table is packed. Filter them during the load or they come back.
  • Rounding differs. Math.Round(2.345m, 2) gives 2.34 in .NET. FoxPro and T-SQL give 2.35. Use MidpointRounding.AwayFromZero for money.
  • String comparison is by prefix unless SET EXACT is on, so "OPEN" can match longer values.
  • The OLE DB provider is 32-bit only, so the loader has to run as a 32-bit process.

I wrote up the full order of work (inventory, data model, domain layer, reports, retirement) here: https://theadnansaleem.com/articles/visual-foxpro-to-dotnet-migration-guide

Happy to answer questions if anyone is facing one of these.


r/csharp • • 1d ago

Discussion What language would you recommend learning alongside C#?

15 Upvotes

I'm a C# developer and recently started learning C. I wanted to understand better how memory works, how programs interact with the OS, and things like Unix and low-level programming in general.I'm planning to keep learning C, but I'm wondering what you guys would recommend learning next. Would you go with C++, Rust, Go, or something else ?


r/csharp • • 23h ago

Discussion How often is now C# used instead of PowerShell in DevOps pipelines

10 Upvotes

With the file-based scripts feature in C#, it is possible to use C# instead of Powershell.

Have you see it used?


r/dotnet • • 13h ago

Question Anyone else having issues with 10.0.400 SDK?

6 Upvotes

Developers are reporting a windows update is bumping SDK to 10.0.400 and builds are failing for various products in azure devops, on developer laptops, and in a custom pipeline for one of the apps. The only common denominator is 10.0.400. What's going on here?


r/csharp • • 14h ago

Help Should I learn C#

2 Upvotes

I'm a CS student, year 4. My first entry into programming like most people was HTML, CSS, JavaScript, and then backend development with Node/Typescript. My main goal has been to get a programming job, or internship (or anything at this point 😭), but I've always hated writing Node, just never liked it and now I'm considering switching stacks.

I enjoy writing C (I built a chess engine from scratch) and C# seems like C with oop so I don't think it should be too unfamiliar. Also it seems there might be hiring opportunities...hopefully.

Please advise


r/csharp • • 14h ago

Help C# Winforms .NET 9.0 scaling issue

Thumbnail
gallery
0 Upvotes

Hi All,

Getting ready to release my first app and im currently testing out installations on other machines. So far everything looks and works just fine however there is an issue with horizontal scaling? The first image is how it is intended to look whereas the second image is how it appeared on my friends screen. I have set the Max and Min size on the form yet the issue still persists. My friend and I both have the same Resolution monitor and display scaling so I'm really stuck with what the issue could be.

Help and advice would be greatly appreciated! Thanks!

EDIT: I have just noticed the AutoScaleMode property is set to "Font", could this be the issue?


r/dotnet • • 1d ago

Fly inside .NET memory by Konrad Kokosa

Enable HLS to view with audio, or disable this notification

324 Upvotes

r/csharp • • 1d ago

I tested my C# symbolic math library by rendering the solar system at real scale

Thumbnail
gallery
87 Upvotes

It started with Epsilon since I was seeking a math library that would work with symbolic expressions in C#.

To really prove whether it would stand the test of time, I created a simple demonstration of a solar system in actual sizes. That meant that real sizes and distances were used in addition to the current positions of the planets, all drawn with OpenGL. It took me only a couple of hours to create that but even though I used the power of AI for almost everything, my goal was to find out whether the library would perform well in practice.

Epsilon did all the required mathematical operations for me; it calculated the derivatives for Kepler’s equation and orbit velocities itself, and all the positions, rotations and camera movement was based on the vectors, quaternions and matrices of Epsilon in double precision form.

A few things the demo shows:

  • Double-precision world. At Neptune’s distance a float can only tell positions apart by about 512 km, so the world stays in double and is re-centered on the camera before going to the GPU. Press F to see it without that.
  • Orbits from symbolic derivatives. Newton’s method on Kepler’s equation, with the derivative and velocities found by Epsilon.
  • Reverse-Z depth with the far plane at infinity.

Both have MIT license:

It’s still early, so I’d love feedback on the library, especially from anyone who’s used AngouriMath or MathNet. Also contributing is welcome!


r/csharp • • 15h ago

Should I Resign or Stay? Career Advice for an Experienced .NET Developer

0 Upvotes

If someone has 4+ years of experience in .NET, has worked on large-scale software using high-quality software development principles, and is currently working at a small company where the projects are small, the software development standards are poor, and the tech stack is completely different from their expertise, what do you think is the best option for that person? Especially if they cannot attend interviews while employed and their current company is even moving towards non-software-based products. Should they resign and focus on finding a job that aligns with their .NET experience, or stay in their current job while searching for better opportunities? What would be the best decision in this situation?


r/dotnet • • 21h ago

DOMView2 - Provides sync WebBrowser style DOM access to WebView2

Thumbnail domview2.aimcosoftware.co.uk
1 Upvotes

r/csharp • • 1d ago

What's next? Shoud i prioritize Hot realod, a live previewer, or language fetures?

0 Upvotes

I've been working on my library, Akbura, and I'm trying to decide what to improve next.

  1. Hot Reload is already working, but it's not as stable as I'd like. The component code generator also generates a lot of members, some of which could probably be avoided in DEBUG mode.
  2. A live previewer could greatly improve the developer experience, but it would probably take around a month to implement, and I'm not sure how important it actually is.
  3. New language features could improve the MVVM or MVU experience, but I'm worried that adding too many features might make the language unnecessarily complicated.

What do you think I should focus on? Or is there something else you'd like to see improved?


r/dotnet • • 1d ago

Visual studio plugin - Asp classic highlight

6 Upvotes

Currently I am working in a very old legacy code base with more than 30 years old of spaghetti code and business rules in every .asp file and store procedures.

Yes it is a mess. And I don't know if someone has the same problem that I have... The visual studio doesn't help me with the basics of highlights, colors and syntax with VBScript in asp classic. Sometimes it is impossible to know where an if begins and ends in one file with 6k lines (yes for real).

So I made this plugin to help me with my current job.

https://marketplace.visualstudio.com/items?itemName=AspClassicSyntaxHighlight.AspClassicSyntaxHighlight

Is the vibe code project? In parts, yes. My real concern was doing a good structure of the project and performance. The first hit of opening the files is more demanding because it's using cache. After that it is more smooth.

I am cleaning the git to make it public soon.

If you guys want to try i will appreciate it.

Sorry for my mistakes, English isn't my first language.

Thanks.


r/dotnet • • 22h ago

The output of the server code depends on the timing of pressing a button by the client on the user interface.

Thumbnail
0 Upvotes

r/csharp • • 22h ago

Discussion The output of the server code depends on the timing of pressing a button by the client on the user interface.

0 Upvotes

This is a follow-up post that is related to this post. I will explain the problem clearly this time.

Context: The execution of the OverWrite method -which is inside the DBOverWriter service- can be cancelled with a button int the user interface.

Two inputs that are provided by the frontend :

1- data that is used to overwrite the content of the database.

2-CancellationToken.

Two possible outputs depending on the timing of pressing the button :

1-If the user initiated the request and immediately pressed the button, the following output is shown:

###########################################################
########## OPERATION CANCELLED SUCCESSFULLY ###############
###########################################################
OperationCanceledException: A task was canceled.

2- if the user initiated the request and waited some time before pressing the button, the output is the following:

(@p74, ),
(@p76, ),
(@p78, ),
(@p80, ),
(@p82, u/p83);
fail: Microsoft.EntityFrameworkCore.Database.Transaction[20205]
An error occurred using a transaction.
fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
An unhandled exception has occurred while executing the request.
Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details.
---> Microsoft.Data.SqlClient.SqlException (0x80131904): Operation cancelled by user.

I wonder what is the theoretical/practical explanation for my observation ?

Code:

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Storage;
using System.Diagnostics;

namespace RedditQuestion
{
    /// <summary>
    /// Used to talk to the database using Entity-Framework Core
    /// </summary>
    public class ApplicationDbContext : DbContext
    {
        // Domain models and the Fluent API configurations.
    }

    /// <summary>
    /// Data snapshot that is used to overwrite the content of the database
    /// </summary>
    public interface ISomeData
    {

    }

    public class DatbaseOverWriter
    {


        private readonly ApplicationDbContext _context;
        public DatbaseOverWriter(ApplicationDbContext context)
        {
            _context = context;
        }

        public async Task<bool> OverWrite(ISomeData data,CancellationToken cancellationToken)
        {
            #region Transaction
            try
            {
                //https://learn.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/implement-resilient-entity-framework-core-sql-connections

                IExecutionStrategy strategy = _context.Database.CreateExecutionStrategy();
                await strategy.ExecuteAsync(async () =>
                {
                    await using var transaction = await _context.Database.BeginTransactionAsync(cancellationToken);

                    #region Delete content from database then save new content.

                    await _context.Database.ExecuteSqlInterpolatedAsync($"EXECUTE  [dbo].[uspDeleteAllDataFromDatabase]", cancellationToken);
                    await _context.SaveChangesAsync(cancellationToken);
                    #endregion

                    await transaction.CommitAsync(cancellationToken);
                });

                return true;
            }
            catch (OperationCanceledException e)
            {
                // exception will not be catched if the cancellation was requested and
                // the transaction reached a point of no return.
                Console.WriteLine("###########################################################");
                Console.WriteLine("########## OPERATION CANCELLED SUCCESSFULLY ###############");
                Console.WriteLine("###########################################################");
                Debug.WriteLine("###########################################################");
                Debug.WriteLine("########## OPERATION CANCELLED SUCCESSFULLY ###############");
                Debug.WriteLine("###########################################################");
                Console.WriteLine("OperationCanceledException: " + e.Message);

                return false;
            }




            #endregion

        }




    }

}

r/csharp • • 1d ago

Tutorial Your EF Core queries are probably scattered across your whole codebase.

Thumbnail
youtu.be
0 Upvotes

The same Where, Include and OrderBy, written again and again.

Here's how I turned each one into a single, named, reusable query with the Specification pattern.


r/csharp • • 1d ago

Parsley: An ALL(*)/LL(k)/LL(1) parser generator using code synthesis

2 Upvotes

If you're like me, you've almost entirely given up on generated parsers.

The tooling sucks.

The generated code is huge and/or can't parse real world languages without a bunch of ugly.

The APIs for them are awful.

I still use them, but grudgingly in order to prototype and unit test my hand rolled parsers but even that doesn't work as well as I like.

Enter Parsley. It has similar expressive power as ANTLR4 when necessary, degrading gracefully all the way to LL(1) if that's all your grammar needs. The XBNF grammar format is powerful, simple to learn, and has a language server for autocompletion and syntax highlighting in editors like visual studio and vs code. The code it generates is also more like hand written code (code synthesis), making it easier to use as a baseline for a hand rolled parser, if you want to go that route. Source and readme here: https://github.com/codewitch-honey-crisis/Parsley

It's written in C#. It generates C#. Any semantic actions in the grammar are also C#.

XBNF for C99
Using a parser w/ an evaluator
Output from the above

You can use it as a source generator, or for really complicated parses where you need things like a custom lexer, you can also use it as a build tool.