When building with visual studio get Payload contains two files with same destination but diff path (Generic.xbf/Generic.xaml) on some machines
Summary
On some machines building will consistently fail giving a payload collision error. There seems to be an OK work around, however new users especially checking out /building the source may hit this and give up. It is also unclear why it happens.
Minimal project and steps to reproduce
Checkout the current 3.x branch try to build. Unfortunately what environments do an do not cause this is unclear but for me building it from clean on VS 16 will cause this error. The slight change in the fix below allows the build to then complete successfully.
What is the current bug behavior?
Does not build compiler throws an error.
What is the expected correct behavior?
A clean checkout with installed dependencies builds without error.
Does it work on other plaforms? Does it work with the official VLC apps?
In talking with mfkl they have also seen this error but only on certain machines. I am not sure what the differentiator is. VS 16.09 and VS 16.11, also had on previous VS versions but not sure which.
Relevant logs and/or screenshots
Error can bounce between Generic.xbf and Generic.xaml (and the files are different as well)
Severity Code Description Project File Line Suppression State
Error Payload contains two or more files with the same destination path 'LibVLCSharp\Themes\Generic.xbf', but they have different content. Source files:
r:\libvlcsharp\src\LibVLCSharp\bin\Debug\uap10.0\LibVLCSharp\Themes\Generic.xbf
r:\libvlcsharp\src\LibVLCSharp.Uno\bin\Debug\uap10.0.16299\LibVLCSharp\Themes\Generic.xbf LibVLCSharp.Uno.Sample.UWP
Error Payload contains two or more files with the same destination path 'LibVLCSharp\Themes\Generic.xbf', but they have different content. Source files:
r:\libvlcsharp\src\LibVLCSharp.Uno\bin\Debug\uap10.0.16299\LibVLCSharp\Themes\Generic.xbf
r:\libvlcsharp\src\LibVLCSharp\bin\Debug\uap10.0\LibVLCSharp\Themes\Generic.xbf Sample.MediaPlayerElement.UWP
Environment
Windows 10.0.19042 3.x branch LibVLCSharp
Possible fixes
An easy work around for me was removing the uap10.0 from the targetframeworks and just leaving the uap10.0.16299 so line:
https://github.com/videolan/libvlcsharp/blob/477fa577d0e407aa65fe116144afe2055d6623a1/src/LibVLCSharp/LibVLCSharp.csproj#L33
becomes <TargetFrameworks Condition="$([MSBuild]::IsOsPlatform('Windows'))">$(TargetFrameworks);uap10.0.16299;net40;net471</TargetFrameworks>
Doing the inverse did not seem to work (removing the uap10.0.16299 leaving uap10.0) causing a different error.