From fb0ff076431f567021cbd0e93203ba07a3ec1b2d Mon Sep 17 00:00:00 2001 From: Dmitriy Vornychev Date: Sat, 13 Jun 2020 01:09:38 +0300 Subject: [PATCH 1/6] Support for project configuration remapping in solution file --- .../ProjectFile/ProjectFileInfo.cs | 4 +-- src/OmniSharp.MSBuild/ProjectIdInfo.cs | 2 ++ src/OmniSharp.MSBuild/ProjectLoader.cs | 36 ++++++++++++++++--- src/OmniSharp.MSBuild/ProjectSystem.cs | 26 ++++++++++++++ 4 files changed, 62 insertions(+), 6 deletions(-) diff --git a/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.cs b/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.cs index ccb3079484..e58790eb6e 100644 --- a/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.cs +++ b/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.cs @@ -110,7 +110,7 @@ public static (ProjectFileInfo, ImmutableArray, ProjectLoaded return (null, ImmutableArray.Empty, null); } - var (projectInstance, diagnostics) = loader.BuildProject(filePath); + var (projectInstance, diagnostics) = loader.BuildProject(filePath, projectIdInfo?.ConfigurationsInSolution); if (projectInstance == null) { return (null, diagnostics, null); @@ -135,7 +135,7 @@ public static (ProjectFileInfo, ImmutableArray, ProjectLoaded public (ProjectFileInfo, ImmutableArray, ProjectLoadedEventArgs) Reload(ProjectLoader loader) { - var (projectInstance, diagnostics) = loader.BuildProject(FilePath); + var (projectInstance, diagnostics) = loader.BuildProject(FilePath, ProjectIdInfo?.ConfigurationsInSolution); if (projectInstance == null) { return (null, diagnostics, null); diff --git a/src/OmniSharp.MSBuild/ProjectIdInfo.cs b/src/OmniSharp.MSBuild/ProjectIdInfo.cs index b1a46a1b26..03b8177434 100644 --- a/src/OmniSharp.MSBuild/ProjectIdInfo.cs +++ b/src/OmniSharp.MSBuild/ProjectIdInfo.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using Microsoft.CodeAnalysis; namespace OmniSharp.MSBuild @@ -13,5 +14,6 @@ public ProjectIdInfo(ProjectId id, bool isDefinedInSolution) public ProjectId Id { get; set; } public bool IsDefinedInSolution { get; set; } + public Dictionary ConfigurationsInSolution { get; set; } } } diff --git a/src/OmniSharp.MSBuild/ProjectLoader.cs b/src/OmniSharp.MSBuild/ProjectLoader.cs index a6b882abaf..a937e3c1d8 100644 --- a/src/OmniSharp.MSBuild/ProjectLoader.cs +++ b/src/OmniSharp.MSBuild/ProjectLoader.cs @@ -67,11 +67,12 @@ private static Dictionary CreateGlobalProperties( return globalProperties; } - public (MSB.Execution.ProjectInstance projectInstance, ImmutableArray diagnostics) BuildProject(string filePath) + public (MSB.Execution.ProjectInstance projectInstance, ImmutableArray diagnostics) BuildProject( + string filePath, Dictionary configurationsInSolution) { using (_sdksPathResolver.SetSdksPathEnvironmentVariable(filePath)) { - var evaluatedProject = EvaluateProjectFileCore(filePath); + var evaluatedProject = EvaluateProjectFileCore(filePath, configurationsInSolution); SetTargetFrameworkIfNeeded(evaluatedProject); @@ -115,10 +116,37 @@ public MSB.Evaluation.Project EvaluateProjectFile(string filePath) } } - private MSB.Evaluation.Project EvaluateProjectFileCore(string filePath) + private MSB.Evaluation.Project EvaluateProjectFileCore(string filePath, Dictionary projectConfigurationsInSolution = null) { + var localProperties = new Dictionary(_globalProperties); + if (projectConfigurationsInSolution != null + && localProperties.TryGetValue(PropertyNames.Configuration, out string solutionConfiguration)) + { + if (!localProperties.TryGetValue(PropertyNames.Platform, out string solutionPlatform)) + { + solutionPlatform = "Any CPU"; + } + + var solutionSelector = $"{solutionConfiguration}|{solutionPlatform}.ActiveCfg"; + _logger.LogDebug($"Found configuration `{solutionSelector}` in solution for '{filePath}'."); + + if (projectConfigurationsInSolution.TryGetValue(solutionSelector, out string projectSelector)) + { + var splitted = projectSelector.Split('|'); + if (splitted.Length == 2) + { + var projectConfiguration = splitted[0]; + localProperties[PropertyNames.Configuration] = projectConfiguration; + // NOTE: Solution often defines configuration as `Any CPU` wheras project relies on `AnyCPU` + var projectPlatform = splitted[1].Replace("Any CPU", "AnyCPU"); + localProperties[PropertyNames.Platform] = projectPlatform; + _logger.LogInformation($"Using configuration from solution: `{projectConfiguration}|{projectPlatform}`"); + } + } + } + // Evaluate the MSBuild project - var projectCollection = new MSB.Evaluation.ProjectCollection(_globalProperties); + var projectCollection = new MSB.Evaluation.ProjectCollection(localProperties); var toolsVersion = _options.ToolsVersion; if (string.IsNullOrEmpty(toolsVersion) || Version.TryParse(toolsVersion, out _)) diff --git a/src/OmniSharp.MSBuild/ProjectSystem.cs b/src/OmniSharp.MSBuild/ProjectSystem.cs index f686850c63..bbfdf96493 100644 --- a/src/OmniSharp.MSBuild/ProjectSystem.cs +++ b/src/OmniSharp.MSBuild/ProjectSystem.cs @@ -161,6 +161,28 @@ public void Initalize(IConfiguration configuration) var processedProjects = new HashSet(StringComparer.OrdinalIgnoreCase); var result = new List<(string, ProjectIdInfo)>(); + var projectConfigurationsInSln = new Dictionary>(); + foreach (var globalSection in solutionFile.GlobalSections) + { + if (globalSection.Name == "ProjectConfigurationPlatforms") + { + _logger.LogDebug($"Parsing ProjectConfigurationPlatforms of '{solutionFilePath}'."); + foreach (var entry in globalSection.Properties) + { + var guid = Guid.Parse(entry.Name.Substring(0, 38)); + var projId = ProjectId.CreateFromSerialized(guid); + var solutionConfig = entry.Name.Substring(39); + + if (!projectConfigurationsInSln.TryGetValue(projId, out var dict)) + { + dict = new Dictionary(); + projectConfigurationsInSln.Add(projId, dict); + } + dict.Add(solutionConfig, entry.Value); + } + } + } + foreach (var project in solutionFile.Projects) { if (project.IsNotSupported) @@ -182,6 +204,10 @@ public void Initalize(IConfiguration configuration) if (string.Equals(Path.GetExtension(projectFilePath), ".csproj", StringComparison.OrdinalIgnoreCase)) { var projectIdInfo = new ProjectIdInfo(ProjectId.CreateFromSerialized(new Guid(project.ProjectGuid)), true); + if (projectConfigurationsInSln.TryGetValue(projectIdInfo.Id, out var configurations)) + { + projectIdInfo.ConfigurationsInSolution = configurations; + } result.Add((projectFilePath, projectIdInfo)); } From b100e3e100a426f31f42baa2d847a31d58066fd6 Mon Sep 17 00:00:00 2001 From: Dmitriy Vornychev Date: Sat, 13 Jun 2020 02:55:48 +0300 Subject: [PATCH 2/6] Add test for solution with custom build configurations --- .../App/App.csproj | 21 +++++++++++++ .../App/Program.cs | 12 ++++++++ .../Lib/Class1.cs | 8 +++++ .../Lib/Lib.csproj | 15 ++++++++++ ...ctsWithSolutionAndCustomConfigurations.sln | 30 +++++++++++++++++++ .../WorkspaceInformationTests.cs | 25 ++++++++++++++++ 6 files changed, 111 insertions(+) create mode 100644 test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/App/App.csproj create mode 100644 test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/App/Program.cs create mode 100644 test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/Lib/Class1.cs create mode 100644 test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/Lib/Lib.csproj create mode 100644 test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/TwoProjectsWithSolutionAndCustomConfigurations.sln diff --git a/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/App/App.csproj b/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/App/App.csproj new file mode 100644 index 0000000000..ae6e22bc3e --- /dev/null +++ b/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/App/App.csproj @@ -0,0 +1,21 @@ + + + + + + + + Debug1;Release1 + + + + Exe + netcoreapp2.1 + + + + Exe + netcoreapp2.1 + + + diff --git a/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/App/Program.cs b/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/App/Program.cs new file mode 100644 index 0000000000..be4278310c --- /dev/null +++ b/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/App/Program.cs @@ -0,0 +1,12 @@ +using System; + +namespace App +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } + } +} diff --git a/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/Lib/Class1.cs b/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/Lib/Class1.cs new file mode 100644 index 0000000000..44e7c59c4d --- /dev/null +++ b/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/Lib/Class1.cs @@ -0,0 +1,8 @@ +using System; + +namespace Lib +{ + public class Class1 + { + } +} diff --git a/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/Lib/Lib.csproj b/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/Lib/Lib.csproj new file mode 100644 index 0000000000..913be0853e --- /dev/null +++ b/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/Lib/Lib.csproj @@ -0,0 +1,15 @@ + + + + Debug2;Release2 + + + + netstandard1.3 + + + + netstandard1.3 + + + diff --git a/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/TwoProjectsWithSolutionAndCustomConfigurations.sln b/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/TwoProjectsWithSolutionAndCustomConfigurations.sln new file mode 100644 index 0000000000..269435be97 --- /dev/null +++ b/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/TwoProjectsWithSolutionAndCustomConfigurations.sln @@ -0,0 +1,30 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30204.135 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "App", "App\App.csproj", "{632DFE45-B56E-4158-8F27-45E2BA0BAFCF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lib", "Lib\Lib.csproj", "{CE41561B-5D13-4688-8686-EEFF744BE8B5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + DebugSln|Any CPU = DebugSln|Any CPU + ReleaseSln|Any CPU = ReleaseSln|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {632DFE45-B56E-4158-8F27-45E2BA0BAFCF}.DebugSln|Any CPU.ActiveCfg = Debug1|Any CPU + {632DFE45-B56E-4158-8F27-45E2BA0BAFCF}.DebugSln|Any CPU.Build.0 = Debug1|Any CPU + {632DFE45-B56E-4158-8F27-45E2BA0BAFCF}.ReleaseSln|Any CPU.ActiveCfg = Release1|Any CPU + {632DFE45-B56E-4158-8F27-45E2BA0BAFCF}.ReleaseSln|Any CPU.Build.0 = Release1|Any CPU + {CE41561B-5D13-4688-8686-EEFF744BE8B5}.DebugSln|Any CPU.ActiveCfg = Debug2|Any CPU + {CE41561B-5D13-4688-8686-EEFF744BE8B5}.DebugSln|Any CPU.Build.0 = Debug2|Any CPU + {CE41561B-5D13-4688-8686-EEFF744BE8B5}.ReleaseSln|Any CPU.ActiveCfg = Debug2|Any CPU + {CE41561B-5D13-4688-8686-EEFF744BE8B5}.ReleaseSln|Any CPU.Build.0 = Debug2|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D5E71A6E-0C92-4CB1-8260-00DE6C30724F} + EndGlobalSection +EndGlobal diff --git a/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs b/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs index fcb4ad746e..0668220cb5 100644 --- a/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs @@ -124,6 +124,31 @@ public async Task TwoProjectsWithSolution() } } + [Fact] + public async Task TwoProjectsWithSolutionAndCustomConfigurations() + { + var configData = new Dictionary { [$"MsBuild:{nameof(Options.MSBuildOptions.Configuration)}"] = "ReleaseSln" }; + using (var testProject = await TestAssets.Instance.GetTestProjectAsync("TwoProjectsWithSolutionAndCustomConfigurations")) + using (var host = CreateMSBuildTestHost(testProject.Directory, configurationData: configData)) + { + var workspaceInfo = await host.RequestMSBuildWorkspaceInfoAsync(); + + Assert.Equal("TwoProjectsWithSolutionAndCustomConfigurations.sln", Path.GetFileName(workspaceInfo.SolutionPath)); + Assert.NotNull(workspaceInfo.Projects); + Assert.Equal(2, workspaceInfo.Projects.Count); + + var firstProject = workspaceInfo.Projects[0]; + Assert.Equal("App.csproj", Path.GetFileName(firstProject.Path)); + Assert.Equal(".NETCoreApp,Version=v2.1", firstProject.TargetFramework); + Assert.Equal("netcoreapp2.1", firstProject.TargetFrameworks[0].ShortName); + + var secondProject = workspaceInfo.Projects[1]; + Assert.Equal("Lib.csproj", Path.GetFileName(secondProject.Path)); + Assert.Equal(".NETStandard,Version=v1.3", secondProject.TargetFramework); + Assert.Equal("netstandard1.3", secondProject.TargetFrameworks[0].ShortName); + } + } + [Fact] public async Task TwoProjectWithGeneratedFile() { From b4aadb99f2b62d3e8ef3ca952e75ddf597145cac Mon Sep 17 00:00:00 2001 From: Dmitriy Vornychev Date: Thu, 30 Jul 2020 12:03:37 +0300 Subject: [PATCH 3/6] Use IReadOnlyDictionary to store configurations Also rename `ConfigurationsInSolution` > `SolutionConfiguration` --- src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.cs | 4 ++-- src/OmniSharp.MSBuild/ProjectIdInfo.cs | 8 +++++++- src/OmniSharp.MSBuild/ProjectLoader.cs | 6 +++--- src/OmniSharp.MSBuild/ProjectSystem.cs | 11 ++++++----- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.cs b/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.cs index e58790eb6e..1c90b7d351 100644 --- a/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.cs +++ b/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.cs @@ -110,7 +110,7 @@ public static (ProjectFileInfo, ImmutableArray, ProjectLoaded return (null, ImmutableArray.Empty, null); } - var (projectInstance, diagnostics) = loader.BuildProject(filePath, projectIdInfo?.ConfigurationsInSolution); + var (projectInstance, diagnostics) = loader.BuildProject(filePath, projectIdInfo?.SolutionConfiguration); if (projectInstance == null) { return (null, diagnostics, null); @@ -135,7 +135,7 @@ public static (ProjectFileInfo, ImmutableArray, ProjectLoaded public (ProjectFileInfo, ImmutableArray, ProjectLoadedEventArgs) Reload(ProjectLoader loader) { - var (projectInstance, diagnostics) = loader.BuildProject(FilePath, ProjectIdInfo?.ConfigurationsInSolution); + var (projectInstance, diagnostics) = loader.BuildProject(FilePath, ProjectIdInfo?.SolutionConfiguration); if (projectInstance == null) { return (null, diagnostics, null); diff --git a/src/OmniSharp.MSBuild/ProjectIdInfo.cs b/src/OmniSharp.MSBuild/ProjectIdInfo.cs index 03b8177434..975fe7c9db 100644 --- a/src/OmniSharp.MSBuild/ProjectIdInfo.cs +++ b/src/OmniSharp.MSBuild/ProjectIdInfo.cs @@ -14,6 +14,12 @@ public ProjectIdInfo(ProjectId id, bool isDefinedInSolution) public ProjectId Id { get; set; } public bool IsDefinedInSolution { get; set; } - public Dictionary ConfigurationsInSolution { get; set; } + + /// + /// Project configurations as defined in solution. + /// Keys are solution build configuration in '$(Configuration)|$(Platform)' format, + /// values are according project configurations. Null if there is no solution. + /// + public IReadOnlyDictionary SolutionConfiguration { get; set; } } } diff --git a/src/OmniSharp.MSBuild/ProjectLoader.cs b/src/OmniSharp.MSBuild/ProjectLoader.cs index a937e3c1d8..52014fa0ba 100644 --- a/src/OmniSharp.MSBuild/ProjectLoader.cs +++ b/src/OmniSharp.MSBuild/ProjectLoader.cs @@ -68,7 +68,7 @@ private static Dictionary CreateGlobalProperties( } public (MSB.Execution.ProjectInstance projectInstance, ImmutableArray diagnostics) BuildProject( - string filePath, Dictionary configurationsInSolution) + string filePath, IReadOnlyDictionary configurationsInSolution) { using (_sdksPathResolver.SetSdksPathEnvironmentVariable(filePath)) { @@ -116,7 +116,7 @@ public MSB.Evaluation.Project EvaluateProjectFile(string filePath) } } - private MSB.Evaluation.Project EvaluateProjectFileCore(string filePath, Dictionary projectConfigurationsInSolution = null) + private MSB.Evaluation.Project EvaluateProjectFileCore(string filePath, IReadOnlyDictionary projectConfigurationsInSolution = null) { var localProperties = new Dictionary(_globalProperties); if (projectConfigurationsInSolution != null @@ -137,7 +137,7 @@ private MSB.Evaluation.Project EvaluateProjectFileCore(string filePath, Dictiona { var projectConfiguration = splitted[0]; localProperties[PropertyNames.Configuration] = projectConfiguration; - // NOTE: Solution often defines configuration as `Any CPU` wheras project relies on `AnyCPU` + // NOTE: Solution often defines configuration as `Any CPU` whereas project relies on `AnyCPU` var projectPlatform = splitted[1].Replace("Any CPU", "AnyCPU"); localProperties[PropertyNames.Platform] = projectPlatform; _logger.LogInformation($"Using configuration from solution: `{projectConfiguration}|{projectPlatform}`"); diff --git a/src/OmniSharp.MSBuild/ProjectSystem.cs b/src/OmniSharp.MSBuild/ProjectSystem.cs index bbfdf96493..e7df327366 100644 --- a/src/OmniSharp.MSBuild/ProjectSystem.cs +++ b/src/OmniSharp.MSBuild/ProjectSystem.cs @@ -161,9 +161,10 @@ public void Initalize(IConfiguration configuration) var processedProjects = new HashSet(StringComparer.OrdinalIgnoreCase); var result = new List<(string, ProjectIdInfo)>(); - var projectConfigurationsInSln = new Dictionary>(); + var solutionConfigurations = new Dictionary>(); foreach (var globalSection in solutionFile.GlobalSections) { + // Try parse project configurations if they are remapped in solution file if (globalSection.Name == "ProjectConfigurationPlatforms") { _logger.LogDebug($"Parsing ProjectConfigurationPlatforms of '{solutionFilePath}'."); @@ -173,10 +174,10 @@ public void Initalize(IConfiguration configuration) var projId = ProjectId.CreateFromSerialized(guid); var solutionConfig = entry.Name.Substring(39); - if (!projectConfigurationsInSln.TryGetValue(projId, out var dict)) + if (!solutionConfigurations.TryGetValue(projId, out var dict)) { dict = new Dictionary(); - projectConfigurationsInSln.Add(projId, dict); + solutionConfigurations.Add(projId, dict); } dict.Add(solutionConfig, entry.Value); } @@ -204,9 +205,9 @@ public void Initalize(IConfiguration configuration) if (string.Equals(Path.GetExtension(projectFilePath), ".csproj", StringComparison.OrdinalIgnoreCase)) { var projectIdInfo = new ProjectIdInfo(ProjectId.CreateFromSerialized(new Guid(project.ProjectGuid)), true); - if (projectConfigurationsInSln.TryGetValue(projectIdInfo.Id, out var configurations)) + if (solutionConfigurations.TryGetValue(projectIdInfo.Id, out var configurations)) { - projectIdInfo.ConfigurationsInSolution = configurations; + projectIdInfo.SolutionConfiguration = configurations; } result.Add((projectFilePath, projectIdInfo)); } From c4582ba611fed8e3d448418e58cac30e17788439 Mon Sep 17 00:00:00 2001 From: Dmitriy Vornychev Date: Thu, 30 Jul 2020 12:05:13 +0300 Subject: [PATCH 4/6] Fix: Use LogDebug instead of LogInformation to show mapped configuration --- src/OmniSharp.MSBuild/ProjectLoader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OmniSharp.MSBuild/ProjectLoader.cs b/src/OmniSharp.MSBuild/ProjectLoader.cs index 52014fa0ba..6001538a1f 100644 --- a/src/OmniSharp.MSBuild/ProjectLoader.cs +++ b/src/OmniSharp.MSBuild/ProjectLoader.cs @@ -140,7 +140,7 @@ private MSB.Evaluation.Project EvaluateProjectFileCore(string filePath, IReadOnl // NOTE: Solution often defines configuration as `Any CPU` whereas project relies on `AnyCPU` var projectPlatform = splitted[1].Replace("Any CPU", "AnyCPU"); localProperties[PropertyNames.Platform] = projectPlatform; - _logger.LogInformation($"Using configuration from solution: `{projectConfiguration}|{projectPlatform}`"); + _logger.LogDebug($"Using configuration from solution: `{projectConfiguration}|{projectPlatform}`"); } } } From 5f2c3813ddcb6588e45b2d659cd6a633027fee4c Mon Sep 17 00:00:00 2001 From: Dmitriy Vornychev Date: Thu, 30 Jul 2020 12:06:01 +0300 Subject: [PATCH 5/6] Fix: Use Release configuration for project in custon configurations test --- .../TwoProjectsWithSolutionAndCustomConfigurations.sln | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/TwoProjectsWithSolutionAndCustomConfigurations.sln b/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/TwoProjectsWithSolutionAndCustomConfigurations.sln index 269435be97..7d7a37b495 100644 --- a/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/TwoProjectsWithSolutionAndCustomConfigurations.sln +++ b/test-assets/test-projects/TwoProjectsWithSolutionAndCustomConfigurations/TwoProjectsWithSolutionAndCustomConfigurations.sln @@ -18,8 +18,8 @@ Global {632DFE45-B56E-4158-8F27-45E2BA0BAFCF}.ReleaseSln|Any CPU.Build.0 = Release1|Any CPU {CE41561B-5D13-4688-8686-EEFF744BE8B5}.DebugSln|Any CPU.ActiveCfg = Debug2|Any CPU {CE41561B-5D13-4688-8686-EEFF744BE8B5}.DebugSln|Any CPU.Build.0 = Debug2|Any CPU - {CE41561B-5D13-4688-8686-EEFF744BE8B5}.ReleaseSln|Any CPU.ActiveCfg = Debug2|Any CPU - {CE41561B-5D13-4688-8686-EEFF744BE8B5}.ReleaseSln|Any CPU.Build.0 = Debug2|Any CPU + {CE41561B-5D13-4688-8686-EEFF744BE8B5}.ReleaseSln|Any CPU.ActiveCfg = Release2|Any CPU + {CE41561B-5D13-4688-8686-EEFF744BE8B5}.ReleaseSln|Any CPU.Build.0 = Release2|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 36f1a54d7ec162f7d78cfbe02cb64de64857f4ad Mon Sep 17 00:00:00 2001 From: Dmitriy Vornychev Date: Thu, 30 Jul 2020 13:17:42 +0300 Subject: [PATCH 6/6] Fix compilation error after merge --- tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs b/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs index 0668220cb5..bbdea5bd56 100644 --- a/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs @@ -129,7 +129,7 @@ public async Task TwoProjectsWithSolutionAndCustomConfigurations() { var configData = new Dictionary { [$"MsBuild:{nameof(Options.MSBuildOptions.Configuration)}"] = "ReleaseSln" }; using (var testProject = await TestAssets.Instance.GetTestProjectAsync("TwoProjectsWithSolutionAndCustomConfigurations")) - using (var host = CreateMSBuildTestHost(testProject.Directory, configurationData: configData)) + using (var host = CreateMSBuildTestHost(testProject.Directory, configurationData: configData.ToConfiguration())) { var workspaceInfo = await host.RequestMSBuildWorkspaceInfoAsync();