-
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
maui workload 8.0.61/8.0.100 introduced NativeAOT runtime error in EFC .net 8 #23595
Comments
We're running into this same issue, I was guessing that it was related to the UseInterpreter changes that went into the latest xamairn-macios library (https://github.com/xamarin/xamarin-macios/releases/tag/dotnet-8.0.1xx-8078) I'll post if I find any more information or workarounds, but this is blocking us from releasing at the moment. |
Can you create and attach a binlog please? |
Working on getting a local build to generate the same error, but if that doesn't work out, I'll add the argument to our automated builds. |
This may be related to #23577. |
Tweaking the MtouchInterpreter value on the DevOps build ends up 'locking up' the build on the hosted agents, it pauses indefinitely with no progress and eventually gets killed by the devops infrastructure, no amount of cancelling through the UI is effective. Local builds complete successfully, but resulting executable crashes on launch prior to doing anything (I think this is related to local config/permissions/etc). If I'm able to convince DevOps to give me a log, I'll try to post it, but I'm coming up empty at the moment. |
ok, adding the following to our dotnet build command allowed the build to process through and appears at first glance to stop the crashing:
This is, I think, equivalent to the behavior prior to this latest iOS workload release, so it's fine for now, but would be good to figure out how to get some of the benefit of AOT while still carving out the interpreter for things like EFCore. |
Also having this issue, is there a way to install the old version of the workloads. Didn't realise this was the issue and been fighting it for 2 days. |
Duplicate of #23577 |
@RuddyOne Yes, you can use a rollback file - though i believe it's not officially supported. Useful for a temporary workaround though.
|
Thank you for that, useful info. I have ended up with @bengavin workaround at the moment, not sure if there is a downside though. Might look at changing to this rollback for now. Much appreciated. |
I guess we have the same problem: #23653 |
Description
We use Azure DevOps Pipeline to build Maui .Net 8 iOS app. This runtime error is throw by EF.Sqlite .net 8 when calling DbContext.Migrate(). The error started to occur yesterday with no yaml change in our azure build pipeline.
Here is the runtime error message:
I found this answer stating that the NativeAOT publishing is not yet supported on EFC .net 8.
We compared the Installed .NET SDK and MAUI workload version on Azure MAUI build Pipeline between Wednesday (No error) and Friday(Has NativeAOT error):
Both builds installed .NET SDK: 8.0.300
Wednesday (No error) - installed maui workload 8.0.40/8.0.100
Friday(Has NativeAOT error) - installed maui workload 8.0.61/8.0.100
It looks like maui workload 8.0.61 has introduced the EF NativeAOT error. I have not found a working solution that allows us to install specified maui workload version.
I have tried the following work-arounds, but no luck so far:
install maui workload with specific version using '--from-rollback-file'
dotnet workload install maui --from-rollback-file https://maui.blob.core.windows.net/metadata/rollbacks/8.0.1xx.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json --source https://api.nuget.org/v3/index.json
This will fail with message:
Workload installation failed: Failed to install manifest microsoft.net.sdk.maui version 8.0.4: Version 8.0.4 of package microsoft.net.sdk.maui.manifest-8.0.100 is not found in NuGet feeds [https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json"..]
Add
<PublishAot>false</PublishAot>
to Maui project to disable Publish AOTSteps to Reproduce
Create a Maui iOS azure build pipeline using the following YAML configuration:
Create a MAUI project that use "Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.4". It should contains a code either call DbContext.Database.Migrate() or DbContext.Database.EnsureCreated().
Install the build onto a iOS device (don't use simulator)
App crashes when DbContext.Database.Migrate() or DbContext.Database.EnsureCreated() is called.
Link to public reproduction project repository
No response
Version with bug
8.0.61 SR6.1
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
8.0.40 SR5
Affected platforms
iOS
Affected platform versions
iOS 17
Did you find any workaround?
NO
Relevant log output
No response
The text was updated successfully, but these errors were encountered: