Closed drewrobey closed 12 hours ago
We've found some similar issues:
If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.
Note: You can give me feedback by 👍 or 👎 this comment.
Besides updating Visual Studio did you update anything else? At the very least updating Visual Studio probably updated your workloads. Are you using $(MauiVersion)
in your csproj file to reference the .NET MAUI version? If yes, then also your .NET MAUI SDK got updated.
Do you have some more complete build logs or anything besides just the error messages?
Are you building .NET 8 or .NET 9? What is the output of dotnet --info
and dotnet workload list
?
What can typically help is delete the bin & obj folders, do a Clean, do a Rebuild to make sure nothing cached is left behind and everything is build with the latest and greatest.
Hi @jfversluis
The VS update was the first thing we did this morning, and we close every day with working builds, so nothing else has changed.
I'm attempting a dotnet workload update
now. All errors seem to be connected to Visual Studio no longer recognising the Maui compatibility toolkit on both Android and iOS, so I'm guessing that solving that will eliminate all the errors.
Let us know how it goes!
Unfortunately that hasn't fixed it. The core lynchpin error, for Android at least, is:
We use the compat toolkit in all our projects, so the class signature on Android's MainActivity is always:
public class MainActivity : MauiAppCompatActivity
...and if it can't resolve that, then it can't build anything else, or find any of the compat stuff used elsewhere.
EDIT: I've just created a new Maui project, using compat, and that won't build either, so something is awry with the VS update.
what do you mean by compat toolkit? do you mean a reference to Microsoft.Maui.Controls.Compatibility
?
that line for public class MainActivity : MauiAppCompatActivity
has no connection to Microsoft.Maui.Controls.Compatibility
Well if that's not the compat toolkit stuff then the build issue is at a higher Maui level than the compat stuff.
EDIT: If we remove Microsoft.Maui.Controls.Compatibility from Nuget then we can build. I shall experiment further.
well, on microsoft's maui documentation it says to remove the compatibility package reference when going from .net8 to .net9
Interesting. We'd not moved any of the apps to .net 9 yet, but I think it might be time.
if you updated maui to 9.0, aren't you using a .net9 package?
Not until this morning.
Solved it. The sequence that worked for us is:
We've done this on 3 of 7 workstations, and things will build again (with a ton of new warnings that weren't there before, but never mind).
I'll presume that the other 4 will also succeed with this, so I think this can be closed.
Description
We have a 5 Maui projects, and since updating Visual Studio last night, all now fail to build, with a variety of new error messages:
All of these projects built successfully yesterday before the update, both on Android and iOS.
Steps to Reproduce
Link to public reproduction project repository
No response
Version with bug
9.0.10 SR1
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
No response
Affected platforms
Android, iOS, Windows, macOS
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output