I created a new UWP MSTest Project and I added a reference to my main application. When I build the solution, get the an error:
Payload contains two or more files with the same destination path
Along with the conflicting files. I checked the copy to local for the files and they are set to Do not copy. Here's a sample of the error messages:
Severity Code Description Project File Line Suppression State Error Payload contains two or more files with the same destination path 'Assets\Square44x44Logo.targetsize-24_altform-unplated.png'. Source files: C:\Users\joe.nuget\packages\newtonsoft.json\11.0.1-beta1\lib\netstandard2.0\Newtonsoft.Json.dll C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\TestPlatform.Universal\15.5\Redist\CommonConfiguration\neutral\Newtonsoft.Json.dll App.Test C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets 1747
Error Payload contains two or more files with the same destination path 'Assets\Wide310x150Logo.scale-200.png'. Source files: E:\App.Test\Assets\Wide310x150Logo.scale-200.png E:\App\Assets\Wide310x150Logo.scale-200.png App.Test C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets 1747
This happens when the content file names are the same for the app itself and the test project. Even though you set them to Do not copy, they are still conflicting during the intermediate step of building the test project.
The simplest solution is to rename or delete the Asset
PNGs
inside the Test Project so that they do not conflict with your app itself.
Problem with Newtonsoft.Json
is a known issue that has been reported to the Visual Studio team and the fix is now pending release.
The only workaround mentioned is the following by Morten Nielsen:
As a workaround and if you can live with the v9 version the test project ships with, you can add a direct assembly reference to the Json.net lib that they use, instead of using the nuget reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With