CsWinRT
CsWinRT copied to clipboard
Publish fails using cswinrt and wpf in .net 8
Describe the bug I'm trying to create a .net 8 WPF app that uses Azure.Communication.Calling.WindowsClient. The app builds and runs, but fails to publish in VS. The release|x64 build succeeds and runs, but if I try to create a self-contained publish, the publish fails. I've
To Reproduce -Create a WPF (.net 8) app that uses Azure.Communication.Calling using cswinRT. I have the following in my csproj file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseWPF>true</UseWPF>
<Platforms>x64</Platforms>
<CsWinRTEmbedded>true</CsWinRTEmbedded>
<CsWinRTWindowsMetadata>10.0.22621.0</CsWinRTWindowsMetadata>
<CsWinRTIncludes>
Azure.Communication.Calling.WindowsClient;
Azure.WinRT.Communication;
Azure.WinRT.Core;
WinRT;
Windows.Foundation;
Windows.Storage;
Windows.Devices;
Windows.Globalization;
Windows.Networking;
Windows.Graphics;
Windows.Security;
Windows.Media;
Windows.UI;
Windows.System;
Windows.Perception;
Windows.ApplicationModel;
Windows.Data;
Windows.Web;
Windows.Management;
Windows.Gaming;
Windows.Services;
</CsWinRTIncludes>
<CsWinRTExcludes>
Windows.Foundation.PropertyType;
</CsWinRTExcludes>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.8" />
</ItemGroup>
<ItemGroup>
<!--Note-should move this or make relative-->
<CsWinRTInputs Include=".\ACSAssemblies\Azure.Communication.Calling.WindowsClient.winmd" />
</ItemGroup>
<ItemGroup>
<None Include="ACSAssemblies\Azure.Communication.Calling.WindowsClient.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="ACSAssemblies\RtmCodecs.dll">
</None>
<None Include="ACSAssemblies\RtmMediaManager.dll">
</None>
<None Include="ACSAssemblies\RtmMvrMf.dll">
</None>
<None Include="ACSAssemblies\RtmPal.dll">
</None>
<None Include="ACSAssemblies\RTMPLTFM.dll">
</None>
<None Include="ACSAssemblies\skypert.dll">
</None>
<None Include="ACSAssemblies\SlimCV.dll">
</None>
<None Include="ACSAssemblies\ssScreenVVS2.dll">
</None>
<ContentWithTargetPath Include="ACSAssemblies\Azure.Communication.Calling.WindowsClient.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>Azure.Communication.Calling.WindowsClient.dll</TargetPath>
</ContentWithTargetPath>
<ContentWithTargetPath Include="ACSAssemblies\RtmCodecs.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>RtmCodecs.dll</TargetPath>
</ContentWithTargetPath>
<ContentWithTargetPath Include="ACSAssemblies\RtmMediaManager.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>RtmMediaManager.dll</TargetPath>
</ContentWithTargetPath>
<ContentWithTargetPath Include="ACSAssemblies\RtmMvrMf.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>RtmMvrMf.dll</TargetPath>
</ContentWithTargetPath>
<ContentWithTargetPath Include="ACSAssemblies\RtmPal.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>RtmPal.dll</TargetPath>
</ContentWithTargetPath>
<ContentWithTargetPath Include="ACSAssemblies\RTMPLTFM.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>RTMPLTFM.dll</TargetPath>
</ContentWithTargetPath>
<ContentWithTargetPath Include="ACSAssemblies\skypert.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>skypert.dll</TargetPath>
</ContentWithTargetPath>
<ContentWithTargetPath Include="ACSAssemblies\SlimCV.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>SlimCV.dll</TargetPath>
</ContentWithTargetPath>
<ContentWithTargetPath Include="ACSAssemblies\ssScreenVVS2.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>ssScreenVVS2.dll</TargetPath>
</ContentWithTargetPath>
</ItemGroup>
</Project>
Expected Behavior Publish should succeed Version Info Using CSWinrt 2.0.8. VS 2022 Enterprise Version 17.10.5
Additional context I've uploaded a sample application to https://icescape-my.sharepoint.com/:u:/g/personal/cbardon_computer-talk_com/EdRYUjX992pNo7iOtMAWbGwB_ggtZCmB5XyfXvl0LAXb0g?e=YKMVaZ that demonstrates the problem. The console app and WPF app do the same thing. Console app publishes successfully, WPF one does not.