I'm trying to start a dotnet MAUI app following the tutorial of MS in their official docs I'm just opening the startup MAUI project(the built-in default one) and VS22 just won't have it. I get 40 errors most of them about reference missing and duplication of classes/functions
now I have already seen a post here having somewhat of the same problem but the solutions(restarting and downloading workloads from the CLI using - dotnet workload intall
) just didn't work for me.
I haven't done any changes to the code whatsoever so I really don't get what is the problem here.
any help would be appreciated.
Edit 1: The app do seems to be working when I run the android simulator… which makes it even weirder
CodePudding user response:
This is a bug in the tooling at the moment it seems. If you look at the errors, especially the ones in your screenshot you can see that these talk about Android. If you expand the Project column for a little you will see the list of target platforms that it's talking about.
Because everything is in 1 project now, it gives errors about platform-specific stuff because it is only looking at that one target that it's building. In this case, maybe you were building iOS and it gives errors about not being able to find Android types. This makes sense, however, we shouldn't see these errors in this case.
It's a bit hard to explain like this, I hope it makes any sense.
Long story short, it's a bug, it's being worked on. And you should be able to ignore them and it would still run as you've already discovered yourself. It gives a lot of noise however and if there is an actual error, you will have to find that in this list and fix that.