This error crops up from time to time since the last upgrade (15.8.4). There aren't two of them, of course. Absolutely nothing was changed about ApplicationXaml items. The project stays the same all the time. The error only goes away if I:
1. remove the ApplicationDefiniton build action of App.xaml
2. try to build (now I get the error of having no Main, obviously)
3. re-set it again and rebuild.
_This issue has been moved from https://developercommunity.visualstudio.com/content/problem/336945/xamarinuwp-a-project-cannot-have-more-than-one-app.html
VSTS ticketId: 685375_
_These are the original issue comments:_
William Menant on 9/23/2018, 03:15 PM (246 days ago):
Same error here. Do you solve it please ?
Thanks
Norman MacKay on 10/1/2018, 06:04 AM (239 days ago):
Thanks for this, workaround allows me to compile. This also happens in 15.8.5.
Lukasz on 10/2/2018, 03:11 AM (238 days ago):
I'll just add that (in my case at least) in step 2 you don't even need to build. Just:
1. Remove ApplicationDefinition.
2. Add ApplicationDefinition again.
3. Build and it works.
Pretty annoying having this error 3+ times a day.
Samantha Houts [MSFT] on 11/2/2018, 02:01 PM (206 days ago):
We appreciate you taking the time to report this problem. We are currently prioritizing problems that are impacting a broad set of our customers, so we may not be able to investigate this one immediately. We know this problem is important to you, so we will continue to monitor it.
Colin Schmale on 11/7/2018, 02:38 PM (201 days ago):
I've got the same problem. Cleaning the solution helps but the error always comes back next time I try to run it.
G谩bor De谩k Jahn on 11/15/2018, 06:06 AM (194 days ago):
Couldn't you do something more than just considering? It's 15.8.9 now, five (!) upgrades since having reported the bug and it's still alive and kicking.
G谩bor De谩k Jahn on 11/30/2018, 06:21 AM (179 days ago):
15.9.3 and counting...
Clay Brinlee on 12/19/2018, 10:45 AM (160 days ago):
Guys! Click the button at top to upvote this issue!
Ian Elsinga on 12/29/2018, 04:25 PM (149 days ago):
15.9.4 - bug is still there. Please fix.
Peter Bossier on 1/16/2019, 03:00 AM (132 days ago):
15.9.5 - bug is still there. Please fix.
dbuljubasic on 2/4/2019, 02:22 PM (112 days ago):
same here, UWP is sad
Rodrigo Roglio on 2/20/2019, 05:57 AM (97 days ago):
Same here, unfortunatelly...
Version 15.9.6
_These are the original issue solutions:_
Tony Sedgwick solved on 10/3/2018, 04:30 AM (237 days ago), 1 votes:
Just updated to 15.8.6 and have same error
Fix for me is to Clean Solution every time before running...
benjamin solved on 11/21/2018, 00:28 AM (188 days ago), 0 votes:
Just get this problem on 15.9.2, didn't have any problem before. Removing and resetting ApplicationDefinition did work.
G谩bor De谩k Jahn solved on 11/30/2018, 06:24 AM (179 days ago), 0 votes:
Maybe too early to call but on 15.9.3 I have it a little bit differently now. The error is the same, however, now it seems to rear its ugly head only on fresh start of VS. In addition to removing and re-adding the AppDef, simply loading another project and the re-loading the original one also seems to help. I hope I'm not saying it too soon...
Paul Long solved on 1/2/2019, 06:32 AM (146 days ago), 0 votes:
This just happen to me on two different machines with two different projects. The workaround, changing the build action from None and back to ApplicaitonDefinition fix the problem in both cases. I'm using Visual Studio community 15.9.3.
James Oliver solved on 1/14/2019, 03:05 PM (133 days ago), 0 votes:
VS 15.9.5: Simply touching the .csproj file prompts VS to reload and then all is well, until the problem comes back after a restart.
Markus Strobl solved on 5/27/2019, 04:22 AM (31 hours ago), 0 votes:
Just got the same error on Visual Studio 2019 16.1.1.
I was able to "solve" it by performing "clean solution" followed by a rebuild.
If anyone finds themselves here can you please attach a repro of your project that is exhibiting these issues? I've been running UWP projects for some time now in vs 2019 and I've never ran into this so there must be something about the way projects are setup that exhibit this behavior
I also get this from time to time and a simply unload/reload of the UWP app fixes it.
@MagicAndre1981 Any chance you've got a repro project?
nope, happens only from time to time without any chance to repro. This is more a VS issue than XF issue, because it also happens in past for pur UWP/Win8 projects
@MagicAndre1981 Thanks! That was my assumption, as well. We'll go ahead and close this now, but if anyone has other thoughts, let us know!
This might not be the reason this is happening to most people, but none of the fixes worked for me and I eventually found that in a shared project I had another item that's build action had been incorrectly set to 'ApplicationDefinition'. Correcting that item's build action made the error go away.
Hang on, we've been redirected here from VS Community (https://developercommunity.visualstudio.com/content/problem/336945/xamarinuwp-a-project-cannot-have-more-than-one-app.html) which has been marked as duplicate. Now on here, this has been closed as it's a Visual Studio issue. So where are we supposed to track this bug?
This is a Visual Studio bug, no Xamarin issue. Try the workaround with un/reloading the UWP project
Reopening as I see this consistently how that I'm starting to work with Forms UWP more & it would be a good one to fix, as it's fairly annoying. @PureWeen ping me on Teams and I can help provide repro steps. Thanks much.
Now we have VS Version 16.8.2 - more than two years after this issue initially reported (Sep 16, 2018 on VS Community) - and suddenly, it shows up for me as well. Annoying bug needs fixing please .......
Most helpful comment
Hang on, we've been redirected here from VS Community (https://developercommunity.visualstudio.com/content/problem/336945/xamarinuwp-a-project-cannot-have-more-than-one-app.html) which has been marked as duplicate. Now on here, this has been closed as it's a Visual Studio issue. So where are we supposed to track this bug?