From 58e3e0a4f720ed6f560e02c4a8bb17dd169ac4e7 Mon Sep 17 00:00:00 2001 From: Bryan Roth Date: Thu, 4 Dec 2025 17:55:23 -0500 Subject: [PATCH 1/3] Fix: .NET SDK install was failing with missing dependencies Update the required dependencies for the lates Raspian/Raspberry Pi OS based upon MS docs: https://learn.microsoft.com/en-us/dotnet/core/install/linux-debian?tabs=dotnet10#dependencies Use script to test for Debian version to maintain previous functionality. As Raspberry Pi apparently has always been Debian based this should be backwards compatible. https://stackoverflow.com/a/75195665 --- RaspberryDebugger/Connection/Connection.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/RaspberryDebugger/Connection/Connection.cs b/RaspberryDebugger/Connection/Connection.cs index f5f0362..dd8b08c 100644 --- a/RaspberryDebugger/Connection/Connection.cs +++ b/RaspberryDebugger/Connection/Connection.cs @@ -591,11 +591,22 @@ private async Task InstallSdkPrerequsitesAsync() if ! apt-get update ; then exit 1 fi - - if ! apt-get install -yq libc6 libgcc1 libgssapi-krb5-2 libicu-dev libssl1.1 libstdc++6 zlib1g libgdiplus ; then - exit 1 + + debianVersion=$(cat /etc/debian_version) + versionTwelve='12' + if dpkg --compare-versions $debianVersion gt $versionTwelve + then + # Debian 12 or newer + if ! apt-get install -yq libc6 libgcc-s1 libgssapi-krb5-2 libicu-dev libssl3 libstdc++6 zlib1g libgdiplus ; then + exit 1 + fi + else + # Older than Debian 12 + if ! apt-get install -yq libc6 libgcc1 libgssapi-krb5-2 libicu-dev libssl1.1 libstdc++6 zlib1g libgdiplus ; then + exit 1 + fi fi - + exit 0 """; From 21397293f21201f514f117213d5068ee9eb5bc0b Mon Sep 17 00:00:00 2001 From: Bryan Roth Date: Thu, 11 Dec 2025 08:56:20 -0500 Subject: [PATCH 2/3] Add code to determine what version of VS is being used by the debugger. This code will manage the version of VS that the extension is currently being used in. It helps determine what debugger should be installed and where it is installed on the Pi. MS docs suggest that the version can be selected but don't really provide info on the valid values. Also, while vs2022 works, vs2026 currently does not. So just go with latest for now. --- RaspberryDebugger/Connection/Connection.cs | 12 +++++-- RaspberryDebugger/PackageHelper.cs | 40 +++++++++++++++++++--- 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/RaspberryDebugger/Connection/Connection.cs b/RaspberryDebugger/Connection/Connection.cs index dd8b08c..6bb7951 100644 --- a/RaspberryDebugger/Connection/Connection.cs +++ b/RaspberryDebugger/Connection/Connection.cs @@ -719,10 +719,16 @@ public async Task SetupDebuggerAsync() // see: https://developercommunity.visualstudio.com/t/VS2022-remote-debugging-over-SSH-does-no/10394545#T-N10410651 // This structure is used when Debug->Attach to Process is used. Unfortunately it's tied to // the VS version. - // Currently the VSIX is only targeted to VS2022 so keep the version selector fixed. - // TODO: Use RaspberryDebuggerPackage.VisualStudioVersion for DIR. + // The getvsdbgsh docs suggest that one should use the VS Version to select the proper debugger. I tried + // that as VS2026 has been released. Unfortunately, getvsdbgsh returns an error using "vs2026" as a -v option. + // At least it does at this time anyway. In the process of trying to reverse engineer the valid options for + // -v I noticed that for any version I submitted - vs2019/vs2022/vs2017/latest, the script always attempted + // to download the latest revision of vsdbg. So I'm just going to use latest until that decides to stop working. + // It's going to be installed in the dir associated with the VS version though, keeping the paradigm suggested + // above. var installCommand = - $"""curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v vs2022 -l {PackageHelper.RemoteDebuggerFolder}"""; + //$"""curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v {PackageHelper.VisualStudioVersion} -l {PackageHelper.RemoteDebuggerFolder}"""; + $"""curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l {PackageHelper.RemoteDebuggerFolder}"""; try { diff --git a/RaspberryDebugger/PackageHelper.cs b/RaspberryDebugger/PackageHelper.cs index b867014..528eff1 100644 --- a/RaspberryDebugger/PackageHelper.cs +++ b/RaspberryDebugger/PackageHelper.cs @@ -46,6 +46,16 @@ namespace RaspberryDebugger { + enum VisualStudioVersions + { + Unknown, + + vs2017 = 15, + vs2019, + vs2022, + vs2026 + } + /// /// Package specific constants. /// @@ -61,6 +71,30 @@ internal static class PackageHelper /// private static readonly string ConnectionsPath; + /// + /// Indicates what VS application is currently running. + /// + private static VisualStudioVersions _visualStudioVersion = VisualStudioVersions.Unknown; + public static VisualStudioVersions VisualStudioVersion + { + get + { + if ( _visualStudioVersion == VisualStudioVersions.Unknown ) + { + ThreadHelper.ThrowIfNotOnUIThread(); + + DTE2 dte = (DTE2)Package.GetGlobalService(typeof(SDTE)); + + if (Version.TryParse(dte.Version, out Version result)) + { + Enum.TryParse(result.Major.ToString(), out _visualStudioVersion); + } + } + + return _visualStudioVersion; + } + } + /// /// Directory on the Raspberry Pi where .NET Core SDKs will be installed along with the /// vsdbg remote debugger. @@ -74,15 +108,13 @@ internal static class PackageHelper /// /// Directory on the Raspberry Pi where the vsdbg remote debugger will be installed. - /// Currently the VSIX is only targeted to VS2022 so keep the version selector fixed. - /// TODO: Use RaspberryDebuggerPackage.VisualStudioVersion for DIR.. /// - public const string RemoteDebuggerFolder = "~/.vs-debugger/vs2022"; + public static readonly string RemoteDebuggerFolder = $"~/.vs-debugger/{VisualStudioVersion}"; /// /// Path to the vsdbg program on the remote machine. /// - public const string RemoteDebuggerPath = RemoteDebuggerFolder + "/vsdbg"; + public static string RemoteDebuggerPath = RemoteDebuggerFolder + "/vsdbg"; /// /// Returns the root directory on the Raspberry Pi where the folder where From 69655a9211568c56e70ea31feffb6fda32edb039 Mon Sep 17 00:00:00 2001 From: Bryan Roth Date: Thu, 11 Dec 2025 08:57:18 -0500 Subject: [PATCH 3/3] Fix: Select DeployExtension to make work with VS 2026 It would seem that this was defaulted to ON in earlier visual studio versions. --- RaspberryDebugger/RaspberryDebugger.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/RaspberryDebugger/RaspberryDebugger.csproj b/RaspberryDebugger/RaspberryDebugger.csproj index 0a05bc9..4884e59 100644 --- a/RaspberryDebugger/RaspberryDebugger.csproj +++ b/RaspberryDebugger/RaspberryDebugger.csproj @@ -46,6 +46,7 @@ 4 CS0414 latest + True pdbonly