microsoft / dotnet

This repo is the official home of .NET on GitHub. It's a great starting point to find many .NET OSS projects from Microsoft and the community, including many that are part of the .NET Foundation.
https://devblogs.microsoft.com/dotnet/
MIT License
14.26k stars 2.21k forks source link

Regression in .NET Core 3.0 / VS 2019 16.3 : APPX1101: Payload contains two or more files with the same destination path #1116

Open djee-ms opened 4 years ago

djee-ms commented 4 years ago

Hi,

We have a UWP C++ project which consumes packages for 3 architectures (x86/x64/ARM) and 2 build configurations (Debug/Release).

Until recently (before .NET Core 3.0 and the associated Visual Studio 2019 16.3 release) the project restore its NuGet packages without any issue.

Since we upgraded to 16.3 and .NET Core 3.0 the following issue occurs on automatic restore:

1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets(5991,5): error APPX1101: packages\Microsoft.MixedReality.WebRTC.Native.Core.WinRT.x86.Release.0.2.1-preview-20190917.1\build\native\..\..\runtimes\win10-x86\native\Org.WebRtc.dll
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets(5991,5): error APPX1101: packages\Microsoft.MixedReality.WebRTC.Native.Core.WinRT.x86.Debug.0.2.1-preview-20190917.1\build\native\..\..\runtimes\win10-x86\native\Org.WebRtc.dll
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets(5991,5): error APPX1101: packages\Microsoft.MixedReality.WebRTC.Native.Core.WinRT.x64.Release.0.2.1-preview-20190917.1\build\native\..\..\runtimes\win10-x64\native\Org.WebRtc.dll
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets(5991,5): error APPX1101: packages\Microsoft.MixedReality.WebRTC.Native.Core.WinRT.x64.Debug.0.2.1-preview-20190917.1\build\native\..\..\runtimes\win10-x64\native\Org.WebRtc.dll
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets(5991,5): error APPX1101: packages\Microsoft.MixedReality.WebRTC.Native.Core.WinRT.ARM.Release.0.2.1-preview-20190917.1\build\native\..\..\runtimes\win10-arm\native\Debug\Org.WebRtc.dll
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets(5991,5): error APPX1101: packages\Microsoft.MixedReality.WebRTC.Native.Core.WinRT.ARM.Debug.0.2.1-preview-20190917.1\build\native\..\..\runtimes\win10-arm\native\Debug\Org.WebRtc.dll

I tried various things like removing the Debug config and only using the Release packages, so that for each runtimes architecture there is a unique path, but that still fails. I also forces the path to use debug/release instead of $(Configuration), without success. Or added some Condition directive in the .props files, without success too. I can accept that NuGet doesn't support Debug+Release in the same package, but clearly not supporting win10-x86 alongside win10-x64 is unexpected.

.props files are publicly available on GitHub, see e.g. here. I know there are discrepancies with ARM (see the error above, which shows an extra Debug in the path) but even fixing those we still get an APPX1101 error.

Packages are available from nuget.org, e.g. here.

This is a blocker for releasing a v1.0 of our project, and several of our users already reported being affected.

vivmishra commented 4 years ago

@tommcdon @NKarnam15

tommcdon commented 4 years ago

@djee-ms we apologize for the delayed response. Would it be possible to share a small, reproducible test project that we can use to investigate? I tried a C++ UWP app with Microsoft.MixedReality.WebRTC.native.Core.UWP version 1.0.0-rc1 on the latest VS 16.4 preview and did not repro the problem.

djee-ms commented 4 years ago

@tommcdon sorry I forgot to get back to you, this is not a blocker anymore. This was worked around with microsoft/MixedReality-WebRTC#93 by removing the Org.WebRtc.dll and the associated .winmd file from the NuGet package. We were not using them anyway, we use a .lib with the same content instead (from which the .dll is built), we are not consuming the DLL via WinRT. The corresponding worked-around core packages are version 0.2.2-preview-20191008.1.

To repro you can use a commit earlier than microsoft/MixedReality-WebRTC@a81368c447b376a96237c2e555de3503c46e6ff4 to repro, like its parent commit microsoft/MixedReality-WebRTC@1bc2ca661399f038050b0154d7b4e9a2f87c9f5f, which should still reference some (broken) core NuGet packages 0.2.1-preview-20190917.1 with the Org.WebRtc.dll inside.

NB: Those NuGet packages are the core dependencies consumed by the project; the version numbers to not coincide with the version number of the NuGet packages of the project itself (except for 1.0.0-rc1 where we tried to make things clear and simle by rebuilding everything).

nakarnam commented 4 years ago

@djee-ms thanks for the details. Glad there was a work around. If there is a fix needed in VS, please open a VS feedback item to track the VS specific related problem.

djee-ms commented 4 years ago

I have no idea if there is a VS issue, that is for you to tell me. I opened this issue because things don't work as I expect them to. My "workaround" was to remove some files from my NuGet package, which happens to be a solution in this specific case but is hardly an acceptable workaround in the general case. And I didn't get any explanation yet on why this error is happening, if this is an actual bug or an error of configuration on my side from something I am not understanding.