diff --git a/src/OmniSharp.MSBuild/Options/MSBuildOptions.cs b/src/OmniSharp.MSBuild/Options/MSBuildOptions.cs index 6fa8059e7e..dd302bf4f5 100644 --- a/src/OmniSharp.MSBuild/Options/MSBuildOptions.cs +++ b/src/OmniSharp.MSBuild/Options/MSBuildOptions.cs @@ -4,6 +4,8 @@ public class MSBuildOptions { public string ToolsVersion { get; set; } public string VisualStudioVersion { get; set; } + public string Configuration { get; set; } + public string Platform { get; set; } public bool EnablePackageAutoRestore { get; set; } public string MSBuildExtensionsPath { get; set; } diff --git a/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.PropertyNames.cs b/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.PropertyNames.cs index 7eb647986f..4e3c1f64fd 100644 --- a/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.PropertyNames.cs +++ b/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.PropertyNames.cs @@ -8,6 +8,7 @@ private static class PropertyNames public const string AssemblyName = nameof(AssemblyName); public const string AssemblyOriginatorKeyFile = nameof(AssemblyOriginatorKeyFile); public const string BuildProjectReferences = nameof(BuildProjectReferences); + public const string Configuration = nameof(Configuration); public const string DefineConstants = nameof(DefineConstants); public const string DesignTimeBuild = nameof(DesignTimeBuild); public const string DocumentationFile = nameof(DocumentationFile); @@ -17,6 +18,7 @@ private static class PropertyNames public const string MSBuildSDKsPath = nameof(MSBuildSDKsPath); public const string NoWarn = nameof(NoWarn); public const string OutputPath = nameof(OutputPath); + public const string Platform = nameof(Platform); public const string ProjectAssetsFile = nameof(ProjectAssetsFile); public const string ProjectGuid = nameof(ProjectGuid); public const string ProjectName = nameof(ProjectName); diff --git a/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.cs b/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.cs index ad24d6febc..e4db054862 100644 --- a/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.cs +++ b/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.cs @@ -235,6 +235,18 @@ private static Dictionary GetGlobalProperties(MSBuildOptions opt userOptionValue: options.VisualStudioVersion, environmentValue: null); + globalProperties.AddPropertyIfNeeded( + logger, + PropertyNames.Configuration, + userOptionValue: options.Configuration, + environmentValue: null); + + globalProperties.AddPropertyIfNeeded( + logger, + PropertyNames.Platform, + userOptionValue: options.Platform, + environmentValue: null); + if (PlatformHelper.IsMono) { var monoXBuildFrameworksDirPath = PlatformHelper.MonoXBuildFrameworksDirPath;