Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
iOS and Android are unaffected by this bug.
Short Description: UWP projects fail to deploy when referencing a Bait and Switch PCL project. The error is: error APPX1101: Payload contains two or more files with the same destination path
Steps to reproduce (final solution is zipped & attached for easy repro):
1) Setup Initial Solution
1.1) Install James Montemagno's 'Plugin for Xamarin Template' to easily create a Bait and Switch PCL solution: https://visualstudiogallery.msdn.microsoft.com/afead421-3fbf-489a-a4e8-4a244ecdbb1e
1.2) Visual Studio 2015, File -> New Project -> Under "Visual C#" category find "Plugin for Xamarin", Name it 'BaitAndSwitchUwpFailure' and hit "OK" to create the solution
1.3) To Keep It Simple, delete all projects Except "Plugin.BaitAndSwitchUwpFailure", "Plugin.BaitAndSwitchUwpFailure.Abstractions", and "Plugin.BaitAndSwitchUwpFailure.UWP"
2) Setup Xamarin.Forms App
2.1) Right Click on your Solution, Add New Project -> Cross-Platform Category -> Blank Xaml App (Xamarin.Forms Portable), hit Okay to accept "App1" as the name.
2.1.1) Accept UWP Defaults: Target Version: Windows 10 Anniverssary Edition (10.0; Build 14393). Minimum Version: Windows 10 (10.0; Build 10586)
2.2) To Keep It Simple, delete all App1 projects Except "App1" and "App1.UWP"
3) Update Solution NuGet Packages
3.1) For me this amounted to "Microsoft.NETCore.UniversalWindowsPlatform" going to v 5.2.2 and "Xamarin.Forms" going to ve 18.104.22.168. NOTE: This bug applies regardless of whether or not you update your nugets.
4) Setup and Use References:
4.1) Right-click on App1's References, Add References to "Plugin.BaitAndSwitchUwpFailure" and "Plugin.BaitAndSwitchUwpFailure.Abstractions" projects
4.2) Right-click on App1.UWP's References, Add a reference to "Plugin.BaitAndSwitchUwpFailure.UWP"
5.1) Right-click on "App1.UWP" and set it as your startup project
5.2) Clean and then Build the entire solution
5.3) Right-click on App1.UWP and hit Deploy
5.4) Deploy Fails, See the full error log in the Output window:
1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets(1692,5): error APPX1101: Payload contains two or more files with the same destination path 'Plugin.BaitAndSwitchUwpFailure.pdb'. Source files:
1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets(1692,5): error APPX1101: c:\users\jhand\onedrive\documents\visual studio 2015\Projects\BaitAndSwitch\BaitAndSwitchUwpFailure\Plugin.BaitAndSwitchUwpFailure.UWP\bin\Debug\Plugin.BaitAndSwitchUwpFailure.pdb
1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets(1692,5): error APPX1101: c:\users\jhand\onedrive\documents\visual studio 2015\Projects\BaitAndSwitch\BaitAndSwitchUwpFailure\Plugin.BaitAndSwitchUwpFailure\bin\Debug\Plugin.BaitAndSwitchUwpFailure.pdb
Software: Visual Studio 2015 v 14.0.25431.01 Update 3, full versioning info from Help -> About available in attached zip file: "Visual Studio Help About Info.txt". Windows 10 (up-to-date).
> Here is a blog entry that discussed the issue: http://www.poz1.com/baitswitch/
> Here is a GitHub project that encountered the issue and resolved it by manually referencing DLLs: https://github.com/poz1/TestFeature
> Here is a closed bug report that identifies the issue and above workaround: https://github.com/jamesmontemagno/Xamarin-Templates/issues/8
> A hack workaround has been identified but it requires manually referencing numerous debug OR release DLLs (not projects, thus rendering the 'debug'/'release' combo box useless). This is not an acceptable solution.
The attachment was too large, here is a link that should work for at least a few months: https://drive.google.com/open?id=0BxnW_9WhyR1MRExnTUZ5TEVtOHM
This is not an issue on a Xamarin product.
Hence resolving it as Upstream.
Please report the UWP project system issue using the Visual Studio built-in "Send Feedback" button on the top toolbar (at the left of Quick Launch textbox).