windows-8 - Nuget,可移植库和WinRT appx : Payload contains two or more files with the same destination path

标签 windows-8 windows-runtime nuget portable-class-library appx

  • 创建新的Windows 8应用程序App1
  • ClassLibrary1 Windows 8类库项目添加到解决方案
  • 将针对Windows 8和Windows Phone 7.5的PortableClassLibrary1可移植类库添加到解决方案
  • HttpClient中引用ClassLibrary1 nuget包
  • HttpClient中引用PortableClassLibrary1 nuget包
  • 同时引用ClassLibrary1PortableClassLibrary1
  • 编译解决方案

  • 您在.appx打包阶段收到错误
    Payload contains two or more files with the same destination path 'System.Net.Http.Primitives.dll'. 
    Source files: 
    \Projects\App1\PortableClassLibrary1\bin\Debug\System.Net.Http.Primitives.dll
    \Projects\App1\packages\Microsoft.Net.Http.2.2.13\lib\win8\System.Net.Http.Primitives.dll
    

    请注意,如果引用任何同时具有win8和可移植程序集混合功能的nuget程序包,则会重现相同的错误。

    预期结果:
    库的最特定版本(win8一个)打包为.appx,可移植版本将被忽略

    关于如何欺骗appx打包程序并构建此类Windows 8项目的任何想法?

    最佳答案

    除此之外,您还将收到类似于以下内容的警告:

    All projects referencing ClassLibrary1.csproj must install nuget package Microsoft.Bcl.Build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317569.



    这表明存在问题。简而言之,基本上,应该将HttpClient.Compression安装到所有项目中。 MSBuild/AppX打包不知道要在便携式库和存储库项目之间部署哪个二进制文件(它们具有不同的API和版本)。告诉安装包到应用程序。

    关于windows-8 - Nuget,可移植库和WinRT appx : Payload contains two or more files with the same destination path,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18377876/

    相关文章:

    Azure Development Fabric 日志代理在启动时崩溃

    windows-8 - 如何使用 Windows 8 触发共享操作

    nuget - 'System.Net.Http 4.0. 0' package requires NuGet client version ' 3.0' 或以上

    windows-8 - 我们如何知道 SymmetricAlgorithmNames::AesCbc 在 WinRT 中是 128 位还是 256 位?

    windows-8 - 双屏 metro 应用

    arm - ARM 版本的 Windows 8 是否只能运行 Metro (WinRt) 风格的应用程序?

    azure - 如何摆脱 Nuget

    .Net NuGet 包冲突 - DLL hell 又回来了

    javascript - WinJS,从字节数组显示图像?

    c# - 如何在 sqlite join 从 windows store c#/xaml 应用程序中的多个表返回数据时设置属性类