Skip to content

Commit 5645e0c

Browse files
authored
Add CsWinRT projection producing project for deployment API (#4949)
## Change Produce a CsWinRT projection for Microsoft.Management.Deployment. Move to CsWinRT 2.1.6 across the solution.
1 parent ff86443 commit 5645e0c

File tree

16 files changed

+327
-246
lines changed

16 files changed

+327
-246
lines changed

.github/actions/spelling/expect.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ AMap
1919
Amd
2020
amrutha
2121
ansistring
22+
Aot
2223
APARTMENTTHREADED
2324
apfn
2425
apicontract

src/AppInstallerCLI.sln

Lines changed: 227 additions & 201 deletions
Large diffs are not rendered by default.

src/AppInstallerCLIE2ETests/AppInstallerCLIE2ETests.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99
<DocumentationFile>$(OutDir)\AppInstallerCLIE2ETests.xml</DocumentationFile>
1010
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
1111
<!--
12-
Forcing this version to continue using an older CsWinRT release while issues are resolved.
13-
!!! Remove this on the next Microsoft.Windows.CsWinRT package version update. !!!
12+
!!! Remove or update this on the next Microsoft.Windows.CsWinRT package version update. !!!
1413
-->
15-
<WindowsSdkPackageVersion>10.0.22000.34</WindowsSdkPackageVersion>
14+
<WindowsSdkPackageVersion>10.0.22000.52</WindowsSdkPackageVersion>
1615
</PropertyGroup>
1716

1817
<PropertyGroup>
@@ -30,7 +29,7 @@
3029
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
3130
<PackageReference Include="Microsoft.Msix.Utils" Version="2.1.1" />
3231
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
33-
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.4" />
32+
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.6" />
3433
<PackageReference Include="nunit" Version="3.12.0" />
3534
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
3635
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />

src/ConfigurationRemotingServer/ConfigurationRemotingServer.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@
1111
<SelfContained>true</SelfContained>
1212
<RuntimeIdentifiers>win10-x64;win10-x86;win10-arm;win10-arm64</RuntimeIdentifiers>
1313
<!--
14-
Forcing this version to continue using an older CsWinRT release while issues are resolved.
15-
!!! Remove this on the next Microsoft.Windows.CsWinRT package version update. !!!
14+
!!! Remove or update this on the next Microsoft.Windows.CsWinRT package version update. !!!
1615
-->
17-
<WindowsSdkPackageVersion>10.0.22000.34</WindowsSdkPackageVersion>
16+
<WindowsSdkPackageVersion>10.0.22000.52</WindowsSdkPackageVersion>
1817
</PropertyGroup>
1918

2019
<PropertyGroup Condition=" '$(Platform)' == 'x64' ">
@@ -34,7 +33,7 @@
3433
</PropertyGroup>
3534

3635
<ItemGroup>
37-
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.4" />
36+
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.6" />
3837
</ItemGroup>
3938

4039
<ItemGroup>

src/Microsoft.Management.Configuration.Processor/Microsoft.Management.Configuration.Processor.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@
1919
<Configurations>Debug;Release;ReleaseStatic</Configurations>
2020
<CsWinRTEnableLogging>true</CsWinRTEnableLogging>
2121
<!--
22-
Forcing this version to continue using an older CsWinRT release while issues are resolved.
23-
!!! Remove this on the next Microsoft.Windows.CsWinRT package version update. !!!
22+
!!! Remove or update this on the next Microsoft.Windows.CsWinRT package version update. !!!
2423
-->
25-
<WindowsSdkPackageVersion>10.0.22000.34</WindowsSdkPackageVersion>
24+
<WindowsSdkPackageVersion>10.0.22000.52</WindowsSdkPackageVersion>
2625
</PropertyGroup>
2726

2827
<PropertyGroup Condition="'$(Configuration)'=='Release'">
@@ -43,7 +42,7 @@
4342
</ItemGroup>
4443

4544
<ItemGroup>
46-
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.4" />
45+
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.6" />
4746
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.2.8" GeneratePathProperty="true">
4847
<ExcludeAssets>contentFiles</ExcludeAssets>
4948
</PackageReference>

src/Microsoft.Management.Configuration.Projection/Microsoft.Management.Configuration.Projection.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<Nullable>enable</Nullable>
88
<OutputPath>$(SolutionDir)$(Platform)\$(Configuration)\$(MSBuildProjectName)\</OutputPath>
99
<Configurations>Debug;Release;ReleaseStatic</Configurations>
10+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
1011
<!--
11-
Forcing this version to continue using an older CsWinRT release while issues are resolved.
12-
!!! Remove this on the next Microsoft.Windows.CsWinRT package version update. !!!
12+
!!! Remove or update this on the next Microsoft.Windows.CsWinRT package version update. !!!
1313
-->
14-
<WindowsSdkPackageVersion>10.0.22000.34</WindowsSdkPackageVersion>
14+
<WindowsSdkPackageVersion>10.0.22000.52</WindowsSdkPackageVersion>
1515
</PropertyGroup>
1616

1717
<PropertyGroup>
@@ -28,7 +28,7 @@
2828
</PropertyGroup>
2929

3030
<ItemGroup>
31-
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.4" />
31+
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.6" />
3232
</ItemGroup>
3333

3434
<ItemGroup>

src/Microsoft.Management.Configuration.UnitTests/Microsoft.Management.Configuration.UnitTests.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
<OutputPath>$(SolutionDir)$(Platform)\$(Configuration)\$(MSBuildProjectName)\</OutputPath>
99
<RuntimeIdentifiers>win10-x64;win10-x86;win10-arm;win10-arm64</RuntimeIdentifiers>
1010
<!--
11-
Forcing this version to continue using an older CsWinRT release while issues are resolved.
12-
!!! Remove this on the next Microsoft.Windows.CsWinRT package version update. !!!
11+
!!! Remove or update this on the next Microsoft.Windows.CsWinRT package version update. !!!
1312
-->
14-
<WindowsSdkPackageVersion>10.0.22000.34</WindowsSdkPackageVersion>
13+
<WindowsSdkPackageVersion>10.0.22000.52</WindowsSdkPackageVersion>
1514
</PropertyGroup>
1615

1716
<PropertyGroup Condition="'$(Configuration)'=='Release'">
@@ -24,7 +23,7 @@
2423
</ItemGroup>
2524

2625
<ItemGroup>
27-
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.4" />
26+
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.6" />
2827
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
2928
<PackageReference Include="xunit" Version="2.4.2" />
3029
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net8.0-windows10.0.22000.0</TargetFrameworks>
5+
<Platform>AnyCpu</Platform>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<OutputPath>$(SolutionDir)$(Platform)\$(Configuration)\$(MSBuildProjectName)\</OutputPath>
9+
<Configurations>Debug;Release;ReleaseStatic</Configurations>
10+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
11+
<IsAotCompatible>true</IsAotCompatible>
12+
<DisableRuntimeMarshalling>true</DisableRuntimeMarshalling>
13+
<!--
14+
!!! Remove or update this on the next Microsoft.Windows.CsWinRT package version update. !!!
15+
-->
16+
<WindowsSdkPackageVersion>10.0.22000.53</WindowsSdkPackageVersion>
17+
</PropertyGroup>
18+
19+
<PropertyGroup>
20+
<CsWinRTIncludes>Microsoft.Management.Deployment</CsWinRTIncludes>
21+
<CsWinRTGeneratedFilesDir>$(OutDir)</CsWinRTGeneratedFilesDir>
22+
<CsWinRTWindowsMetadata>10.0.22000.0</CsWinRTWindowsMetadata>
23+
<!-- Ensure Support for Windows 10, Version 1809 -->
24+
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
25+
</PropertyGroup>
26+
27+
<PropertyGroup>
28+
<!-- Workaround for MSB3271 error on processor architecture mismatch -->
29+
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
30+
</PropertyGroup>
31+
32+
<ItemGroup>
33+
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.6" />
34+
</ItemGroup>
35+
36+
<ItemGroup>
37+
<ProjectReference Include="..\Microsoft.Management.Deployment\Microsoft.Management.Deployment.vcxproj">
38+
<OutputItemType>Content</OutputItemType>
39+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
40+
<ReferenceOutputAssembly>True</ReferenceOutputAssembly>
41+
</ProjectReference>
42+
</ItemGroup>
43+
44+
</Project>

src/Microsoft.Management.Deployment.Projection/Microsoft.Management.Deployment.Projection.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@
88
<OutputType>Library</OutputType>
99
<Configurations>Debug;Release;ReleaseStatic</Configurations>
1010
<!--
11-
Forcing this version to continue using an older CsWinRT release while issues are resolved.
12-
!!! Remove this on the next Microsoft.Windows.CsWinRT package version update. !!!
11+
!!! Remove or update this on the next Microsoft.Windows.CsWinRT package version update. !!!
1312
-->
14-
<WindowsSdkPackageVersion>10.0.22000.34</WindowsSdkPackageVersion>
13+
<WindowsSdkPackageVersion>10.0.22000.52</WindowsSdkPackageVersion>
1514
</PropertyGroup>
1615

1716
<ItemGroup>
18-
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.4" />
17+
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.6" />
1918
</ItemGroup>
2019

2120
<!-- CsWinRT properties -->

src/PowerShell/CommonFiles/WinGetAssemblyLoadContext.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// -----------------------------------------------------------------------------
1+
// -----------------------------------------------------------------------------
22
// <copyright file="WinGetAssemblyLoadContext.cs" company="Microsoft Corporation">
33
// Copyright (c) Microsoft Corporation. Licensed under the MIT License.
44
// </copyright>
@@ -81,6 +81,17 @@ internal static Assembly ResolvingHandler(AssemblyLoadContext context, AssemblyN
8181
return null;
8282
}
8383

84+
/// <summary>
85+
/// Handler to resolve unmanaged assemblies.
86+
/// </summary>
87+
/// <param name="assembly">Assembly initiating the unmanaged load.</param>
88+
/// <param name="unmanagedDllName">Unmanaged dll name.</param>
89+
/// <returns>The assembly ptr, zero if not in our assembly location.</returns>
90+
internal static IntPtr ResolvingUnmanagedDllHandler(Assembly assembly, string unmanagedDllName)
91+
{
92+
return WinGetAcl.LoadUnmanagedDll(unmanagedDllName);
93+
}
94+
8495
/// <inheritdoc/>
8596
protected override Assembly Load(AssemblyName assemblyName)
8697
{

0 commit comments

Comments
 (0)