Share via


NuGetPackage 43 errors: Payload contains two or more files with the same destination path

Question

Sunday, November 24, 2019 11:42 AM

Hello,

I have a strange problem with my UWP app for some time now in Visual Studio (Community, first 2017 or 2018 and now 2019). Debugging the app works fine but almost every time I try to build an app package (store -> create app packages -> Microsoft Store or Sideloading) I get exactly 43 errors saying  'Payload contains two or more files with the same destination path'. All all of them refer to the NuGetPackage (I will list some of them below). I sometimes manage to be able to create an app package after trying lots of times and having cleaned & rebuild the app, deleted previous app packages (from the app packages folder in Windows Explorer), restarted Visual Studio and cleaned the NuGetPackage in the VS settings. It seems kind of random when it works.

Does anyone know what more I could do to prevent these 'payload errors'?

Extra info:
VS community version 2019: 16.3.6
NuGetPackages used: Microsoft.NETCore.UniversalWindowsPlatform (6.2.9) and Microsoft.OneDriveSDK (v1.2).
Architecture: neutral
Device families: Windows.Universal min version 10.0.15063.0 (I want the app to still work on my Windows Phone 10).

Some of the errors:

Payload contains two or more files with the same destination path 'System.Threading.dll'. Source files: C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\system.threading\4.0.11\lib\netcore50\System.Threading.dllC:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\system.threading\4.0.11\runtimes\aot\lib\netcore50\System.Threading.dll

Payload contains two or more files with the same destination path 'System.Runtime.InteropServices.WindowsRuntime.dll'. Source files: C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\system.runtime.interopservices.windowsruntime\4.0.1\lib\netcore50\System.Runtime.InteropServices.WindowsRuntime.dllC:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\system.runtime.interopservices.windowsruntime\4.0.1\runtimes\aot\lib\netcore50\System.Runtime.InteropServices.WindowsRuntime.dll

Payload contains two or more files with the same destination path 'System.Reflection.Primitives.dll'. Source files: C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\runtime.any.system.reflection.primitives\4.0.1\lib\netcore50\System.Reflection.Primitives.dllC:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\runtime.aot.system.reflection.primitives\4.0.0\runtimes\aot\lib\netcore50\System.Reflection.Primitives.dll

 

Payload contains two or more files with the same destination path 'System.Diagnostics.Tracing.dll'. Source files: C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\runtime.any.system.diagnostics.tracing\4.1.0\lib\netcore50\System.Diagnostics.Tracing.dllC:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\runtime.aot.system.diagnostics.tracing\4.0.20\runtimes\aot\lib\netcore50\System.Diagnostics.Tracing.dll

All replies (2)

Monday, November 25, 2019 5:24 AM âś…Answered | 1 vote

Hi friend,

Welcome to MSDN forum.

According to your description, it seems that there are some conflicts between old and new version of nuget packages. 

Please try these steps:

  1. go to "C:\Users\user name]\nuget\packages", to delete the package caches
  2. go to visual studio, update Microsoft.NETCore.UniversalWindowsPlatform to latest version
  3. restore your other packages

Then see if it works out. Look forward to your feedback.

Best Regards,

Dylan

MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected]


Monday, November 25, 2019 3:01 PM

Thanks Dylan for your clear and helpful answer. It seems to work now. I followed your 1st step and did not have to restore the packages because they were still there but I did need to rebuild the solution iirc and than do a debug run (otherwise it would give some other errors saying libraries/dependencies are missing or something like that). So thanks again!