- 创建新的Windows 8应用程序
App1
- 将
ClassLibrary1
Windows 8类库项目添加到解决方案中 - 将针对Windows 8和Windows Phone 7.5的
PortableClassLibrary1
便携式类库添加到解决方案中 - 在
ClassLibrary1
中引用HttpClient
nuget包 - 在
PortableClassLibrary1
中引用HttpClient
nuget包 - 同时引用
ClassLibrary1
和PortableClassLibrary1
- 编译解决方案
在.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项目吗?