From 3fecc0ee1b47f8c0be863616fed2abd42a7f3b9f Mon Sep 17 00:00:00 2001 From: Samuel Nussbaum Date: Fri, 24 Jul 2026 15:13:47 +0200 Subject: [PATCH] fix: Visual studio load issue --- src/ElectronNET/build/ElectronNET.Core.props | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ElectronNET/build/ElectronNET.Core.props b/src/ElectronNET/build/ElectronNET.Core.props index 5242960..bf31b8f 100644 --- a/src/ElectronNET/build/ElectronNET.Core.props +++ b/src/ElectronNET/build/ElectronNET.Core.props @@ -5,8 +5,13 @@ 30.4.0 26.0 - $([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier) + so `dotnet build/publish` without -r targets the current OS. + RuntimeInformation.RuntimeIdentifier only exists on .NET 5+, so it's only safe to call + when MSBuild itself is hosted on .NET (Core). Visual Studio's bundled MSBuild.exe runs on + .NET Framework (MSBuildRuntimeType == 'Full'), where that member doesn't exist and the + property function would throw during evaluation, failing solution load. --> + $([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier) + win-x64 true