mirror of
https://github.com/marticliment/WinGet-API-from-CSharp
synced 2026-06-21 13:57:37 +00:00
58 lines
2.7 KiB
XML
58 lines
2.7 KiB
XML
<Project Sdk="Microsoft.NET.Sdk">
|
|
|
|
<PropertyGroup>
|
|
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
|
|
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
|
|
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
|
|
<RootNamespace>DevHome.SetupFlow.Common</RootNamespace>
|
|
<Platforms>x86;x64;arm64</Platforms>
|
|
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
|
|
<Nullable>disable</Nullable>
|
|
</PropertyGroup>
|
|
|
|
<!--
|
|
CsWinRT properties:
|
|
https://github.com/microsoft/CsWinRT/blob/master/nuget/readme.md
|
|
-->
|
|
<PropertyGroup>
|
|
<CsWinRTWindowsMetadata>10.0.19041.0</CsWinRTWindowsMetadata>
|
|
<CsWinRTIncludes>Microsoft.Management.Deployment</CsWinRTIncludes>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<CsWinRTInputs Include="$(TargetDir)\Microsoft.Management.Deployment.winmd" />
|
|
<Content Include="$(TargetDir)\Microsoft.Management.Deployment.winmd" Link="Microsoft.Management.Deployment.winmd" CopyToOutputDirectory="PreserveNewest" />
|
|
<Content Include="$(TargetDir)\winrtact.dll" Link="winrtact.dll" CopyToOutputDirectory="PreserveNewest" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.4" />
|
|
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.49-beta">
|
|
<PrivateAssets>all</PrivateAssets>
|
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
|
</PackageReference>
|
|
|
|
<!--
|
|
Microsoft.WindowsPackageManager.ComInterop nuget targets .NET Framework:
|
|
https://www.nuget.org/packages/Microsoft.WindowsPackageManager.ComInterop#readme-body-tab
|
|
To workaround this issue in this .net project:
|
|
- Suppress warning 1701 (Package not compatible)
|
|
- Do not include nuget assets
|
|
- Generate a property for this package so the path can be referenced
|
|
- Copy the WINMD to the $(TargetDir) before the build starts
|
|
- Feed the $(TargetDir)\WINMD path to CsWinRT in order to generate the projected classes
|
|
NOTE: Suppressing the warning only is not enough as this will cause CoreClrInitFailure (0x80008089) error.
|
|
-->
|
|
<PackageReference Include="Microsoft.WindowsPackageManager.ComInterop" Version="1.5.1572">
|
|
<NoWarn>NU1701</NoWarn>
|
|
<GeneratePathProperty>true</GeneratePathProperty>
|
|
<IncludeAssets>none</IncludeAssets>
|
|
</PackageReference>
|
|
</ItemGroup>
|
|
|
|
<Target Name="CopyWinmdToTargetDir" BeforeTargets="BeforeBuild">
|
|
<Copy SourceFiles="$(PkgMicrosoft_WindowsPackageManager_ComInterop)\lib\Microsoft.Management.Deployment.winmd" DestinationFolder="$(TargetDir)" />
|
|
<Copy SourceFiles="$(PkgMicrosoft_WindowsPackageManager_ComInterop)\runtimes\win10-$(Platform)\native\winrtact.dll" DestinationFolder="$(TargetDir)" />
|
|
</Target>
|
|
</Project>
|