Payload 包含两个或多个具有相同目标路径的文件 [英] Payload contains two or more files with the same destination path

查看:41
本文介绍了Payload 包含两个或多个具有相同目标路径的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个新的 UWP MSTest 项目,并添加了对我的主应用程序的引用.当我构建解决方案时,得到一个错误:

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 包含两个或多个目标路径相同的文件

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:

严重性代码描述项目文件行抑制状态错误有效负载包含两个或多个具有相同目标的文件路径资产\Square44x44Logo.targetsize-24_altform-unplate.png".源文件:C:\Users\joe.nuget\packages\newtonsoft.json\11.0.1-beta1\lib\netstandard2.0\Newtonsoft.Json.dllC:\Program Files (x86)\Microsoft SDKs\WindowsKits\10\ExtensionSDKs\TestPlatform.Universal\15.5\Redist\CommonConfiguration\neutral\Newtonsoft.Json.dll App.Test C:\Program文件 (x86)\Microsoft VisualStudio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets 1747
错误有效负载包含两个或多个具有相同目标的文件路径资产\Wide310x150Logo.scale-200.png".源文件:E:\App.Test\Assets\Wide310x150Logo.scale-200.pngE:\App\Assets\Wide310x150Logo.scale-200.png App.Test C:\Program Files(x86)\Microsoft VisualStudio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets 1747

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.

最简单的解决方案是重命名或删除测试项目中的 Asset PNGs,以免它们与您的应用本身发生冲突.

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.

Newtonsoft.Json 的问题是 已知问题 已报告给 Visual Studio 团队,修复程序现在正在等待发布.

Problem with Newtonsoft.Json is a known issue that has been reported to the Visual Studio team and the fix is now pending release.

提到的唯一解决方法是Morten Nielsen:

The only workaround mentioned is the following by Morten Nielsen:

作为一种解决方法,如果您可以使用 v9 版本,则测试项目附带,您可以添加直接程序集引用到他们使用的 Json.net lib,而不是使用 nuget 引用.

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.

这篇关于Payload 包含两个或多个具有相同目标路径的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆