diff --git a/RaspberryDebugger/Models/VisualStudio/ProjectProperties.cs b/RaspberryDebugger/Models/VisualStudio/ProjectProperties.cs index e0415c3..e2dc15f 100644 --- a/RaspberryDebugger/Models/VisualStudio/ProjectProperties.cs +++ b/RaspberryDebugger/Models/VisualStudio/ProjectProperties.cs @@ -130,6 +130,7 @@ public static ProjectProperties CopyFrom(Solution solution, EnvDTE.Project proje // ASPNETCORE_SERVER.URLS=http://0.0.0.0: var launchSettingsPath = Path.Combine(projectFolder ?? string.Empty, "Properties", "launchSettings.json"); + var activeDebugProfile = (string)project.Properties.Item("ActiveDebugProfile").Value; var commandLineArgs = new List(); var environmentVariables = new Dictionary(); var isAspNet = false; @@ -146,7 +147,7 @@ public static ProjectProperties CopyFrom(Solution solution, EnvDTE.Project proje { foreach (var profile in ((JObject)profiles.Value).Properties()) { - if (profile.Name == project.Name) + if (profile.Name == activeDebugProfile) { var profileObject = (JObject)profile.Value; var environmentVariablesObject = (JObject)profileObject.Property("environmentVariables")?.Value; @@ -263,7 +264,6 @@ string SetLaunchUrl(JObject profileObject) var platformTarget = (string)project.ConfigurationManager.ActiveConfiguration.Properties .Item( "PlatformTarget" ).Value; - // Determine whether the project is Raspberry compatible. var isRaspberryCompatible = isNetCore && outputType == 1 && // 1=EXE @@ -286,6 +286,7 @@ string SetLaunchUrl(JObject profileObject) FullPath = project.FullName, Guid = projectGuid, Configuration = project.ConfigurationManager.ActiveConfiguration.ConfigurationName, + ActiveDebugProfile = activeDebugProfile, IsNetCore = isNetCore, Framework = targetFramework, SdkVersion = new Version( netVersion.Major, netVersion.Minor), @@ -467,6 +468,11 @@ private static List ParseArgs(string commandLine) /// public string Configuration { get; private set; } + /// + /// Returns the Selected Debug profile. + /// + public string ActiveDebugProfile { get; private set; } + /// /// Returns the fully qualified path to the project's output directory. ///