From f0b2fff1e28e014529be73c1ac4a8fbc865fc667 Mon Sep 17 00:00:00 2001 From: nil4 Date: Thu, 15 Oct 2026 13:24:31 +0200 Subject: [PATCH 1/2] Fix startup crash on .NET 11+ (#710) Fixes https://github.com/Fallout-build/Fallout/issues/710 When targeting `net11.0` or running on .NET 11, Fallout projects crashed on startup with: > System.TypeInitializationException: The type initializer for 'Fallout.Common.FalloutBuild' threw an exception. > ---> System.ArgumentException: Expected condition to be true (Parameter 'assemblyLocation == string.Empty || assemblyLocation == invokedLocation') Testing .NET 11 RC1 and RC2 on macOS and Windows, the clause `assemblyLocation == invokedLocation` no longer holds. On macOS: - assemblyLocation = "Fallout/build/bin/Debug/_build.dll" - invokedLocation = "Fallout/build/bin/Debug/_build" On Windows: - assemblyLocation = "Fallout\build\bin\Debug\_build.dll" - invokedLocation = "Fallout\build\bin\Debug\_build.exe" Update the assertion to canonicalize extensions to `.dll` before comparing. --- src/Fallout.Build/FalloutBuild.Statics.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Fallout.Build/FalloutBuild.Statics.cs b/src/Fallout.Build/FalloutBuild.Statics.cs index 83032fbd7..9aaa82c30 100644 --- a/src/Fallout.Build/FalloutBuild.Statics.cs +++ b/src/Fallout.Build/FalloutBuild.Statics.cs @@ -121,7 +121,8 @@ private static AbsolutePath GetBuildAssemblyFile() var assemblyLocation = entryAssembly.Location; var invokedLocation = Environment.GetCommandLineArgs().First(); - Assert.True(assemblyLocation == string.Empty || assemblyLocation == invokedLocation); + Assert.True(assemblyLocation == string.Empty || + Path.ChangeExtension(assemblyLocation, ".dll") == Path.ChangeExtension(invokedLocation, ".dll")); return assemblyLocation != string.Empty ? assemblyLocation : invokedLocation; } From e9e28dd3f64dbf3294ee6334d71d6f179e8a08dd Mon Sep 17 00:00:00 2001 From: nil4 Date: Sat, 17 Oct 2026 19:22:12 +0200 Subject: [PATCH 2/2] Drop assertion --- src/Fallout.Build/FalloutBuild.Statics.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Fallout.Build/FalloutBuild.Statics.cs b/src/Fallout.Build/FalloutBuild.Statics.cs index 9aaa82c30..b87393c2c 100644 --- a/src/Fallout.Build/FalloutBuild.Statics.cs +++ b/src/Fallout.Build/FalloutBuild.Statics.cs @@ -121,8 +121,6 @@ private static AbsolutePath GetBuildAssemblyFile() var assemblyLocation = entryAssembly.Location; var invokedLocation = Environment.GetCommandLineArgs().First(); - Assert.True(assemblyLocation == string.Empty || - Path.ChangeExtension(assemblyLocation, ".dll") == Path.ChangeExtension(invokedLocation, ".dll")); return assemblyLocation != string.Empty ? assemblyLocation : invokedLocation; }