Skip to content

Commit cfa7578

Browse files
authored
Bump MSBuild from 17.11.4 to 17.12.6 (#313)
1 parent 6d81634 commit cfa7578

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
5-
<MicrosoftBuildPackageVersion>17.11.4</MicrosoftBuildPackageVersion>
6-
<MicrosoftBuildPackageVersion Condition="'$(TargetFramework)' == 'net6.0'">17.11.4</MicrosoftBuildPackageVersion>
5+
<MicrosoftBuildPackageVersion>17.12.6</MicrosoftBuildPackageVersion>
6+
<MicrosoftBuildPackageVersion Condition="'$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net8.0' ">17.11.4</MicrosoftBuildPackageVersion>
77
<SystemTextJsonVersion>8.0.5</SystemTextJsonVersion>
88
<SystemTextJsonVersion Condition="'$(TargetFramework)' == 'net6.0'">8.0.5</SystemTextJsonVersion>
99
</PropertyGroup>

src/Microsoft.Build.Utilities.ProjectCreation/BuildManagerHost.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,24 @@ internal static class BuildManagerHost
3838
/// <param name="loggers">An <see cref="IEnumerable{T}" /> containing <see cref="ILogger" /> items to use.</param>
3939
/// <param name="buildRequestDataFlags">The <see cref="BuildRequestDataFlags" /> to use.</param>
4040
/// <returns>A <see cref="BuildResult" /> containing details about the result of the build.</returns>
41-
public static BuildResult Build(string projectFullPath, string[] targets, IDictionary<string, string> globalProperties, IEnumerable<ILogger> loggers, BuildRequestDataFlags buildRequestDataFlags)
41+
public static BuildResult Build(
42+
string projectFullPath,
43+
string[] targets,
44+
#if NET8_0
45+
IDictionary<string, string> globalProperties,
46+
#else
47+
IDictionary<string, string?> globalProperties,
48+
#endif
49+
IEnumerable<ILogger> loggers,
50+
BuildRequestDataFlags buildRequestDataFlags)
4251
{
4352
BuildRequestData buildRequestData = new BuildRequestData(
4453
projectFullPath,
54+
#if NET8_0
4555
globalProperties ?? new Dictionary<string, string>(),
56+
#else
57+
globalProperties ?? new Dictionary<string, string?>(),
58+
#endif
4659
toolsVersion: null,
4760
targets ?? Array.Empty<string>(),
4861
hostServices: null,

src/Microsoft.Build.Utilities.ProjectCreation/ProjectCreator.Build.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,12 @@ private void Restore(IDictionary<string, string>? globalProperties, BuildOutput
544544
Save();
545545

546546
// IMPORTANT: Make a copy of the global properties here so as not to modify the ones passed in
547-
Dictionary<string, string> restoreGlobalProperties = new Dictionary<string, string>(globalProperties ?? ProjectCollection.GlobalProperties);
547+
#if NET8_0
548+
Dictionary<string, string> restoreGlobalProperties =
549+
#else
550+
Dictionary<string, string?> restoreGlobalProperties =
551+
#endif
552+
new(globalProperties ?? ProjectCollection.GlobalProperties);
548553

549554
restoreGlobalProperties["ExcludeRestorePackageImports"] = "true";
550555
restoreGlobalProperties["MSBuildRestoreSessionId"] = Guid.NewGuid().ToString("D");

0 commit comments

Comments
 (0)