Open Bodkens opened 3 months ago
First, this is unrelated to the MAUI UI Framework; this involves the SDK and the runtime. If you reenable the Mono Interpreter (Edit your csproj, add <UseInterpreter>true</UseInterpreter>
) then it should allow that to start, but I'm not sure if Process.Start
is meant to work in an AOT usecase. @rolfbjarne what do you think?
@drasticactions it crashes in case of <UseInterpreter>true</UseInterpreter>
in Universal Release configuration
I can reproduce, this is the stack trace:
System.ExecutionEngineException: Attempting to JIT compile method 'void System.Runtime.Serialization.SerializationGuard:<ThrowIfDeserializationInProgress>g__ThrowIfDeserializationInProgress|0_0 (System.Runtime.Serialization.SerializationInfo,string,int&)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.
at System.Runtime.Serialization.SerializationGuard.ThrowIfDeserializationInProgress(String , Int32& )
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo )
at System.Diagnostics.Process.Start(String )
at maui.MainPage.OnCounterClicked(Object sender, EventArgs e)
My repro project: maui-ea5dca2.zip
IMHO Process.Start
should work with the AOT compiler, but that said it doesn't surprise me all that much that it doesn't, because Process.Start
hasn't been available on platforms where the AOT compiler has existed (Process.Start
doesn't work on iOS).
In any case, moving to dotnet/runtime, since that's where this should be fixed.
/cc @vitek-karas
Description
I have Mac Catalyst application that needs run another app with. I do this with
Process.Start()
It works fine in Debug mode, but when i dodotnet publish
it does not work in Universal build of Release config. It return me this error below. I turned off sandbox mode. Is there another way and more correct way to start applications in Mac?My workload
Installed Workload Id Manifest Version Installation Source maui-maccatalyst 8.0.7/8.0.100 SDK 8.0.100
maui-ios 8.0.7/8.0.100 SDK 8.0.100
maui-android 8.0.7/8.0.100 SDK 8.0.100
maui 8.0.7/8.0.100 SDK 8.0.100
Steps to Reproduce
1) Create example MAUI App 2) In Platform/Entitlements.plist set
com.apple.security.app-sandbox
to false 3) Edit MAUI example app to start another app, for example Weather(Weather can crush if we start it that way but main point that it detects and runs weather app)4) Run and see that it works in debug 5) Create release configuration byg__ThrowIfDeserializationInProgress|0_0 (System.Runtime.Serialization.SerializationInfo,string,int&)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.
dotnet publish -f net8.0-maccatalyst -c Release -p:CreatePackage=false
6) Run bin/Release/net8.0-maccatalyst/MauiApp.app and see that it returns Attempting to JIT compile method 'void System.Runtime.Serialization.SerializationGuard:Link to public reproduction project repository
No response
Version with bug
8.0.7 SR2
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
macOS
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response