Frage

  1. Create new Windows 8 application App1
  2. Add ClassLibrary1 Windows 8 class library project to solution
  3. Add PortableClassLibrary1 portable class library targeting Windows 8 and Windows Phone 7.5 to a solution
  4. Reference HttpClient nuget package in ClassLibrary1
  5. Reference HttpClient nuget package in PortableClassLibrary1
  6. Reference both ClassLibrary1 and PortableClassLibrary1
  7. Compile solution

You get an error at .appx package stage

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

Please note the same error is reproduced if you reference any nuget package featuring both win8 and portable blends of assemblies.

What is expected: Most specific version of a library (win8 one) is packaged into .appx and portable version is ignored

Any ideas on how to cheat appx packager and build this kind of Windows 8 projects?

War es hilfreich?

Lösung 2

In addition to this, you should be getting warnings similar to:

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

This is indicating a problem. Basically, the short of it, you should be installing HttpClient.Compression into all projects. MSBuild/AppX packaging doesn't know which binary to deploy between the portable library and store library project (they have different APIs & versions). Installing the package into the application, tells it.

Andere Tipps

It looks like the solution described here works: http://cyanbyfuchsia.wordpress.com/2013/05/03/payload-contains-two-or-more-files-with-the-same-destination-path/

Basically, you must set "Copy local" to false in the WinRT project that is referenced from the main app.

I had such issue too. It was because I shared one of my solution between projects. I had to rename the solution, because the name was all the same like one of the projects. After renaming I had this problem.

I fixed it by: right click on solution I renamed and used both projects, then properties, then use same name in the assembly name like solution name.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top