-
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
.NET 8.0.10 breaks MAUI builds #21170
Comments
Just to say that I have run our azure devops pipeline against 8.0.10 and all worked building both iOS and android |
Is this happening on application or library? I am asking because many ppl use MSBuild.Sdk.Extras to release Maui/Xamarin library but there is propably not support for newer .NET versions so MauiXaml and similar may be problematic. Btw: There is also possible to emit generated files (purposely) by using @ .csproj: |
@Domik234 this is a MAUI application. |
I am not sure, is there an official |
@MAUIoxo there is an official 8.0.10 release. |
Yeah, this is "maui" repo. But I've asked the question because many people tries to support both using one nuget (I am also using this method and works for me) and I know that there is this specific problem. 😁 Try this This works for me as it should so cannot repro the problem. Also don't forget to remove "bin" and "obj" folder after the version change at your project.
There was released Maui Version 8.0.10 yesterday. (SR3?) 😀 |
Thanks @Domik234 - I see that your test project doesn't include the |
I am sorry about that. 😅 I believe that specifying the Just switched it to use the Do not forget to remove and restart VS before testing build & run. 😁 |
I'm seeing the same issue for a maui app thats been in development for some time, the build is fine on
And suddenly I'm greeted with hundreds of errors, all related to I've confirmed I'm using the latest 8.0.10 package, I've cleared my bin/obj folder and restored the solution and the result is the same. I've tested this some of my demo maui apps that don't use any codebehind features (except This looks like quite a serious issue that will brick 8.0.10 for any existing maui users, I'm happy to provide more verbose logs for investigation from my failing project. |
I turned on detailed logging and have a stack trace for the argument null exception thrown by the code gen:
|
Probably some null check is needed here:
/cc @mgoertz-msft |
I'll take a look... |
I am getting the same error on a big Xamarin to Maui conversion project I am working on. Have had to move the packages back to 8.0.7 as none of the workarounds mentioned work. |
I have a fix. See associated PR #21192 |
Hopefully a fix can be pushed out quickly. 8.0.10 fixes a number of issues we are running into, but now causes hundreds of build errors. |
Thanks @mgoertz-msft . I see there are tests failing that are preventing the PR from being allowed to be approved - please can you resolve those asap as we really need the fix - I have to explain to the client today that I wasted a day on this issue and would like to be able to say that the new version of the maui packages will be released very soon. |
I too have run into this. |
@mgoertz-msft Do you happen to have an idea of when this fix will be released? Looks like it was merged into the "SR3" branch. Just wondering if there was a timeline on it's release. |
Can you test with the latest nightly build? |
We're prepping a patch release to SR3 now |
Using |
I also tested with 8.0.14 (from the nightly stream) and the build works |
We also ran into this issue and it's currently blocking our release. Tested the 8.0.20-nightly.10336 and can confirm that the build works fine. |
8.0.14 was released to NuGet which should fix this. You can see more information about updating to the latest NuGet here: #20159 |
Thanks for the quick fix, confirmed working on my app using |
Description
I've updated our MAUI project to 8.0.10 today and cannot build for Android or iOS. I updated by changing the
<MauiVersion>
tag in our .csproj to<MauiVersion>8.0.10</MauiVersion>
.I see this warning in the build log:
This is followed by many errors related to XAML files not correctly linking to their corresponding codebehind (e.g.
Error CS0103 : The name 'InitializeComponent' does not exist in the current context
).I have tried this on the latest versions of VS 2022 for Windows, and Rider for Mac, targeting Android and iOS respectively.
Steps to Reproduce
dotnet workload update
Link to public reproduction project repository
No response
Version with bug
8.0.10
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
8.0.7
Affected platforms
iOS, Android
Affected platform versions
Android 10, iOS 17.3.1
Did you find any workaround?
Rollback to .NET 8.0.7.
Relevant log output
1>CSC: Warning CS8785 : Generator 'CodeBehindGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentNullException' with message 'Value cannot be null. (Parameter 'second')'.
The text was updated successfully, but these errors were encountered: