-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating Visual Studio 2022 to 17.12.1 breaks all Maui builds #26020
Comments
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.
|
Besides updating Visual Studio did you update anything else? At the very least updating Visual Studio probably updated your workloads. Are you using 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 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 |
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: ...and if it can't resolve that, then it can't build anything else, or find any of the compat stuff used elsewhere. EDIT: |
what do you mean by compat toolkit? do you mean a reference to |
Well if that's not the compat toolkit stuff then the build issue is at a higher Maui level than the compat stuff. EDIT: |
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. |
Does anyone have steps for resolving this without having to upgrade to .NET 9 (currently on .net 7)? Example error: GitHub Action runners. I do not have the bandwidth to upgrade all my projects to .NET 9 right now. That is on the roadmap for 2025. This fixed my local builds in Visual Studio, but it did not fix GHA builds. |
@philosowaffle Are you using Microsoft.Maui.Controls.Compatibility? There was another VS update released in the last 24 hours, have you got this yet? |
I was going to try out Maui today, I'm hitting this same problem, I installed 17.12.2. I can build and run a new Maui .net8 project, I can build a new .net9 maui project, I can't build the sample project from: https://github.com/CommunityToolkit/Maui On a fresh install of the git repo.
Where global.json is the default from the repo:
Errors are:
|
@NickDrouin I've never used one of the sample projects, so I can't comment on that directly, but .Net 9 has certainly changed much of the former ways Maui was configured to run (some methods have been tweaked, some methods deprecated and replaced, etc) so there's a distinct possibility that that sample project is now out-of-date and won't quite meet the latest standards. |
Sounds as a real world consideration... |
Eventually found my way to this issue and a solution that would allow me to build .net7 workloads in GitHub Actions. The changeset is here, but I believe the magic sauce was adding these two steps: - name: Set global.json
run: dotnet new globaljson --sdk-version 7.0.100
- name: Restore MAUI Workloads
run: dotnet workload restore |
It certainly works in development PC's and also Github Actions. |
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
The text was updated successfully, but these errors were encountered: