Skip to content

Commit

Permalink
Update to .NET 8 and PS SDK 7.4 (#5078)
Browse files Browse the repository at this point in the history
## Change
.NET 6 and PowerShell SDK 7.2 are no longer supported. This change
updates the uses of the PowerShell SDK to 7.4 and all .NET 6 projects to
.NET 8.
  • Loading branch information
JohnMcPMS authored Dec 18, 2024
1 parent 08b6de0 commit c2c922c
Show file tree
Hide file tree
Showing 23 changed files with 66 additions and 76 deletions.
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,15 @@ jobs:
TargetFolder: '$(artifactsDir)\AppxPackages'

- task: CopyFiles@2
displayName: 'Copy native binaries for Microsoft.WinGet.Client (net6)'
displayName: 'Copy native binaries for Microsoft.WinGet.Client (net8)'
inputs:
SourceFolder: $(buildOutDir)
Contents: |
Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.dll
Microsoft.Management.Deployment\Microsoft.Management.Deployment.winmd
WindowsPackageManager\WindowsPackageManager.dll
UndockedRegFreeWinRT\winrtact.dll
TargetFolder: $(buildOutDirAnyCpu)\PowerShell\Microsoft.WinGet.Client\net6.0-windows10.0.22000.0\SharedDependencies\$(BuildPlatform)
TargetFolder: $(buildOutDirAnyCpu)\PowerShell\Microsoft.WinGet.Client\net8.0-windows10.0.22000.0\SharedDependencies\$(BuildPlatform)
flattenFolders: true

- task: CopyFiles@2
Expand Down Expand Up @@ -212,7 +212,7 @@ jobs:
inputs:
SourceFolder: $(buildOutDirAnyCpu)
Contents: |
Microsoft.Management.Configuration.Projection\net6.0-windows10.0.22000.0\Microsoft.Management.Configuration.Projection.dll
Microsoft.Management.Configuration.Projection\net8.0-windows10.0.22000.0\Microsoft.Management.Configuration.Projection.dll
TargetFolder: $(buildOutDirAnyCpu)\PowerShell\Microsoft.WinGet.Configuration\SharedDependencies\$(BuildPlatform)
flattenFolders: true

Expand All @@ -237,7 +237,7 @@ jobs:
- task: CopyFiles@2
displayName: 'Copy Files: WinGetUtilInterop.UnitTests'
inputs:
SourceFolder: '$(Build.SourcesDirectory)\src\WinGetUtilInterop.UnitTests\bin\$(buildPlatform)\$(BuildConfiguration)\net6.0'
SourceFolder: '$(Build.SourcesDirectory)\src\WinGetUtilInterop.UnitTests\bin\$(buildPlatform)\$(BuildConfiguration)\net8.0'
TargetFolder: '$(artifactsDir)\WinGetUtilInterop.UnitTests\'
CleanTargetFolder: true
OverWrite: true
Expand Down
2 changes: 1 addition & 1 deletion src/AppInstallerCLICore/AppInstallerCLICore.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@
<PropertyGroup>
<!-- The output path for this project is different on some builds where the RIDs are not used in the output. -->
<MicrosoftManagementConfigurationProcessorPath>$(SolutionDir)\AnyCPU\$(Configuration)\Microsoft.Management.Configuration.Processor\Microsoft.Management.Configuration.Processor.winmd</MicrosoftManagementConfigurationProcessorPath>
<MicrosoftManagementConfigurationProcessorPath Condition="!Exists('$(MicrosoftManagementConfigurationProcessorPath)')">$(SolutionDir)\AnyCPU\$(Configuration)\Microsoft.Management.Configuration.Processor\net6.0-windows10.0.22000.0\win\Microsoft.Management.Configuration.Processor.winmd</MicrosoftManagementConfigurationProcessorPath>
<MicrosoftManagementConfigurationProcessorPath Condition="!Exists('$(MicrosoftManagementConfigurationProcessorPath)')">$(SolutionDir)\AnyCPU\$(Configuration)\Microsoft.Management.Configuration.Processor\net8.0-windows10.0.22000.0\win\Microsoft.Management.Configuration.Processor.winmd</MicrosoftManagementConfigurationProcessorPath>
</PropertyGroup>
<Message Importance="high" Text="Microsoft.Management.Configuration.Processor.winmd -&gt; $(MicrosoftManagementConfigurationProcessorPath)" />
<Error Condition="!Exists('$(MicrosoftManagementConfigurationProcessorPath)')" Text="Microsoft.Management.Configuration.Processor.winmd was not found in $(MicrosoftManagementConfigurationProcessorPath)" />
Expand Down
11 changes: 3 additions & 8 deletions src/AppInstallerCLIE2ETests/AppInstallerCLIE2ETests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\AppInstallerCLIE2ETests\</OutDir>
<IsPackable>false</IsPackable>
<Platforms>x64;x86</Platforms>
Expand All @@ -11,7 +11,7 @@
<!--
!!! Remove or update this on the next Microsoft.Windows.CsWinRT package version update. !!!
-->
<WindowsSdkPackageVersion>10.0.22000.52</WindowsSdkPackageVersion>
<WindowsSdkPackageVersion>10.0.22000.53</WindowsSdkPackageVersion>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -25,7 +25,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.2.23" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.6" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Microsoft.Msix.Utils" Version="2.1.1" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
Expand All @@ -38,11 +38,6 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
<PackageReference Include="System.Formats.Asn1" Version="6.0.1" />
<PackageReference Include="System.IO.Packaging" Version="6.0.1" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="6.0.4" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="6.0.8" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="6.0.1" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
</ItemGroup>

Expand Down
11 changes: 4 additions & 7 deletions src/AppInstallerCLIPackage/AppInstallerCLIPackage.wapproj
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,14 @@
copy "$(TargetDir)\resources.pri" "$(TargetDir)\AppInstallerCLI\resources.pri"
</PostBuildEvent>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)'=='ARM'">
<ConfigServerRid>win10-arm</ConfigServerRid>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)'=='ARM64'">
<ConfigServerRid>win10-arm64</ConfigServerRid>
<ConfigServerRid>win-arm64</ConfigServerRid>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)'=='x64'">
<ConfigServerRid>win10-x64</ConfigServerRid>
<ConfigServerRid>win-x64</ConfigServerRid>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)'=='x86'">
<ConfigServerRid>win10-x86</ConfigServerRid>
<ConfigServerRid>win-x86</ConfigServerRid>
</PropertyGroup>
<Target Name="WinGetIncludeAdditionalFilesInPackage" AfterTargets="_ComputeAppxPackagePayload">
<PropertyGroup>
Expand All @@ -253,7 +250,7 @@
<WinGetAdditionalPackageFile Include="$(WinGetAdditionalPackageFileRoot)\AnyCPU\$(Configuration)\Microsoft.Management.Configuration.Projection\**\Microsoft.Management.Configuration.Projection.dll">
<PackagePath>ConfigurationRemotingServer\Microsoft.Management.Configuration.Projection.dll</PackagePath>
</WinGetAdditionalPackageFile>
<WinGetAdditionalPackageFile Include="$(WinGetAdditionalPackageFileRoot)\$(PlatformTarget)\$(Configuration)\ConfigurationRemotingServer\net6.0-windows10.0.22000.0\$(ConfigServerRid)\**\*">
<WinGetAdditionalPackageFile Include="$(WinGetAdditionalPackageFileRoot)\$(PlatformTarget)\$(Configuration)\ConfigurationRemotingServer\net8.0-windows10.0.22000.0\$(ConfigServerRid)\**\*">
<PackagePath>ConfigurationRemotingServer</PackagePath>
<Recurse>true</Recurse>
</WinGetAdditionalPackageFile>
Expand Down
18 changes: 7 additions & 11 deletions src/ConfigurationRemotingServer/ConfigurationRemotingServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,30 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0-windows10.0.22000.0</TargetFramework>
<TargetFramework>net8.0-windows10.0.22000.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<SupportedOSPlatformVersion>10.0.17763.0</SupportedOSPlatformVersion>
<Platforms>x64;x86;arm;arm64</Platforms>
<Platforms>x64;x86;arm64</Platforms>
<OutputPath>$(SolutionDir)$(Platform)\$(Configuration)\$(MSBuildProjectName)\</OutputPath>
<SelfContained>true</SelfContained>
<RuntimeIdentifiers>win10-x64;win10-x86;win10-arm;win10-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers>win-x64;win-x86;win-arm64</RuntimeIdentifiers>
<!--
!!! Remove or update this on the next Microsoft.Windows.CsWinRT package version update. !!!
-->
<WindowsSdkPackageVersion>10.0.22000.52</WindowsSdkPackageVersion>
<WindowsSdkPackageVersion>10.0.22000.53</WindowsSdkPackageVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(Platform)' == 'x64' ">
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>

<PropertyGroup Condition=" '$(Platform)' == 'x86' ">
<RuntimeIdentifier>win10-x86</RuntimeIdentifier>
</PropertyGroup>

<PropertyGroup Condition=" '$(Platform)' == 'arm' ">
<RuntimeIdentifier>win10-arm</RuntimeIdentifier>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
</PropertyGroup>

<PropertyGroup Condition=" '$(Platform)' == 'arm64' ">
<RuntimeIdentifier>win10-arm64</RuntimeIdentifier>
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/IndexCreationTool/IndexCreationTool.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\IndexCreationTool\</OutDir>
<Platforms>x64;x86</Platforms>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/LocalhostWebServer/LocalhostWebServer.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\LocalhostWebServer\</OutDir>
<Platforms>x64;x86</Platforms>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ param(

# Copy the winmd into the unit test directory since it will be needed for marshalling
$Local:winmdSourcePath = Join-Path $BuildOutputPath "Microsoft.Management.Configuration\Microsoft.Management.Configuration.winmd"
$Local:winmdTargetPath = Join-Path $BuildOutputPath "Microsoft.Management.Configuration.UnitTests\net6.0-windows10.0.22000.0\Microsoft.Management.Configuration.winmd"
$Local:winmdTargetPath = Join-Path $BuildOutputPath "Microsoft.Management.Configuration.UnitTests\net8.0-windows10.0.22000.0\Microsoft.Management.Configuration.winmd"

Copy-Item $Local:winmdSourcePath $Local:winmdTargetPath -Force

# Copy the OOP helper dll into the unit test directory to make activation look the same as in-proc
$Local:dllSourcePath = Join-Path $BuildOutputPath "Microsoft.Management.Configuration.OutOfProc\Microsoft.Management.Configuration.OutOfProc.dll"
$Local:dllTargetPath = Join-Path $BuildOutputPath "Microsoft.Management.Configuration.UnitTests\net6.0-windows10.0.22000.0\Microsoft.Management.Configuration.dll"
$Local:dllTargetPath = Join-Path $BuildOutputPath "Microsoft.Management.Configuration.UnitTests\net8.0-windows10.0.22000.0\Microsoft.Management.Configuration.dll"

Copy-Item $Local:dllSourcePath $Local:dllTargetPath -Force

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<DotNetVersion>net6.0</DotNetVersion>
<DotNetVersion>net8.0</DotNetVersion>
<!-- Keep in sync with attributes in AssemblyInfo.cs -->
<TargetFramework>$(DotNetVersion)-windows10.0.22000.0</TargetFramework>
<Nullable>enable</Nullable>
Expand All @@ -21,7 +21,7 @@
<!--
!!! Remove or update this on the next Microsoft.Windows.CsWinRT package version update. !!!
-->
<WindowsSdkPackageVersion>10.0.22000.52</WindowsSdkPackageVersion>
<WindowsSdkPackageVersion>10.0.22000.53</WindowsSdkPackageVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
Expand All @@ -43,18 +43,13 @@

<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.6" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.2.8" GeneratePathProperty="true">
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.6" GeneratePathProperty="true">
<ExcludeAssets>contentFiles</ExcludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
<PackageReference Include="System.IO.Packaging" Version="6.0.1" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="6.0.3" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="6.0.6" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="6.0.1" />
<PackageReference Include="System.Formats.Asn1" Version="6.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0-windows10.0.22000.0</TargetFramework>
<TargetFramework>net8.0-windows10.0.22000.0</TargetFramework>
<Platform>AnyCpu</Platform>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -11,7 +11,7 @@
<!--
!!! Remove or update this on the next Microsoft.Windows.CsWinRT package version update. !!!
-->
<WindowsSdkPackageVersion>10.0.22000.52</WindowsSdkPackageVersion>
<WindowsSdkPackageVersion>10.0.22000.53</WindowsSdkPackageVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public OutOfProcAttribute()
// The test runner is located somewhere like this:
// C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\TestPlatform
// and the command line from there is:
// .\vstest.console.exe "<location of your repo>\src\x64\Debug\Microsoft.Management.Configuration.UnitTests\net6.0-windows10.0.22000.0\Microsoft.Management.Configuration.UnitTests.dll" --TestCaseFilter:Category=OutOfProc
// .\vstest.console.exe "<location of your repo>\src\x64\Debug\Microsoft.Management.Configuration.UnitTests\net8.0-windows10.0.22000.0\Microsoft.Management.Configuration.UnitTests.dll" --TestCaseFilter:Category=OutOfProc
}
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0-windows10.0.22000.0</TargetFramework>
<TargetFramework>net8.0-windows10.0.22000.0</TargetFramework>
<Nullable>enable</Nullable>
<SupportedOSPlatformVersion>10.0.17763.0</SupportedOSPlatformVersion>
<Platforms>x64;x86;arm64</Platforms>
<OutputPath>$(SolutionDir)$(Platform)\$(Configuration)\$(MSBuildProjectName)\</OutputPath>
<RuntimeIdentifiers>win10-x64;win10-x86;win10-arm;win10-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers>win-x64;win-x86;win-arm64</RuntimeIdentifiers>
<!--
!!! Remove or update this on the next Microsoft.Windows.CsWinRT package version update. !!!
-->
<WindowsSdkPackageVersion>10.0.22000.52</WindowsSdkPackageVersion>
<WindowsSdkPackageVersion>10.0.22000.53</WindowsSdkPackageVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
Expand All @@ -25,6 +25,9 @@
<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.6" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Private.Uri" Version="4.3.2" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -39,7 +42,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Moq" Version="4.18.2" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.2.18" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.6" GeneratePathProperty="true" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,25 +607,25 @@ public void TestSet_Serialize_0_3()
Assert.Equal(2, set.Units.Count);

this.VerifyValueSet(set.Metadata, new KeyValuePair<string, object>("description", "FakeSetDescription"));
this.VerifyValueSet(set.Variables, new("var1", "Test1"), new("var2", 42));
this.VerifyValueSet(set.Variables, new ("var1", "Test1"), new ("var2", 42));

Assert.Equal(2, set.Parameters.Count);
this.VerifyParameter(set.Parameters[0], "param1", Windows.Foundation.PropertyType.String, true);
this.VerifyParameter(set.Parameters[1], "param2", Windows.Foundation.PropertyType.Int64, false, 89);

Assert.Equal("FakeModule/FakeResource", set.Units[0].Type);
Assert.Equal("TestId", set.Units[0].Identifier);
this.VerifyValueSet(set.Units[0].Metadata, new("description", "FakeDescription"), new("allowPrerelease", true), new("securityContext", "elevated"));
this.VerifyValueSet(set.Units[0].Settings, new("TestString", "Hello"), new("TestBool", false), new("TestInt", 1234));
this.VerifyValueSet(set.Units[0].Metadata, new ("description", "FakeDescription"), new ("allowPrerelease", true), new ("securityContext", "elevated"));
this.VerifyValueSet(set.Units[0].Settings, new ("TestString", "Hello"), new ("TestBool", false), new ("TestInt", 1234));

Assert.Equal("FakeModule2/FakeResource2", set.Units[1].Type);
Assert.Equal("TestId2", set.Units[1].Identifier);
this.VerifyStringArray(set.Units[1].Dependencies, "TestId", "dependency2", "dependency3");
this.VerifyValueSet(set.Units[1].Metadata, new("description", "FakeDescription2"), new("securityContext", "elevated"));
this.VerifyValueSet(set.Units[1].Metadata, new ("description", "FakeDescription2"), new ("securityContext", "elevated"));

ValueSet mapping = new ValueSet();
mapping.Add("Key", "TestValue");
this.VerifyValueSet(set.Units[1].Settings, new("TestString", "Bye"), new("TestBool", true), new("TestInt", 4321), new("Mapping", mapping));
this.VerifyValueSet(set.Units[1].Settings, new ("TestString", "Bye"), new ("TestBool", true), new ("TestInt", 4321), new ("Mapping", mapping));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\Microsoft.Management.Deployment.Projection\</OutDir>
<IsPackable>false</IsPackable>
<Platforms>x64;x86;arm64</Platforms>
Expand All @@ -10,7 +10,7 @@
<!--
!!! Remove or update this on the next Microsoft.Windows.CsWinRT package version update. !!!
-->
<WindowsSdkPackageVersion>10.0.22000.52</WindowsSdkPackageVersion>
<WindowsSdkPackageVersion>10.0.22000.53</WindowsSdkPackageVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit c2c922c

Please sign in to comment.