I have a UWP project and when i try to build it for ARM it builds fine, however, when I build it for x86 or x64 I am getting 'A project cannot have more than one ApplicationXaml item'. I have tried to clean the solution and rebuild again but the error couldn't go away. I have also tried to change the build action and rebuild again but no luck so far. Any idea? I am using Visual Studio Enterprise 2017.
This is a Visual Studio 2017 bug, which was also reported to Microsoft and which I also suffer from time to time.
There are some steps to "fix" it:
ApplicationDefinition
and add it back.
Now try to run the app.
This is summary of possible solutions as posted on the Microsoft and Git pages for this issue as well as on this SO page. Some solutions are faster/simpler than others so I have ordered possible solutions from the easiest to the more involved fixes and included some more detailed instructions for folks that are new to VS.
According to the git page for this issue it was confirmed by Microsoft staff to be a VS bug. It's been around for about 3 years and as of 2020 has unfortunately STILL not been fixed.
Possible solutions:
If these are already correct, remove the definitions (set build action to none) then set them back to the correct settings again.
Edit the UWP.csproj (remove some part, save proj and ignore reload, now add the removed part back, save and reload project).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With