Mac - keep data in memory and get data
Hi,
I run mac app in vs code net 8.
after publishing it using this command: dotnet publish -f net8.0-maccatalyst -c Release
The app stop working me, the logic not working.
I keep data in singelton class and I reach from other pages to this class.
It work on window but not on mac ?
Why ? what i loose?
Thanks,
.NET MAUI
-
Dani_S 3,786 Reputation points
2024-07-14T13:38:47.74+00:00 or maybee there is another problem that com from the publish,
-
Dani_S 3,786 Reputation points
2024-07-14T13:47:26.2+00:00 All http call stop working , why ?
-
Bruce (SqlWork.com) 66,056 Reputation points
2024-07-14T17:02:00.7866667+00:00 Anything in the console log?
-
Dani_S 3,786 Reputation points
2024-07-14T18:39:00.7233333+00:00 It seems http call not working? Why?
-
Dani_S 3,786 Reputation points
2024-07-15T20:33:47.6366667+00:00 Why is not working, problem with publish
-
Dani_S 3,786 Reputation points
2024-07-17T08:16:05.5866667+00:00 Your quick answer will be appreciated.
-
Dani_S 3,786 Reputation points
2024-07-17T08:43:51.2633333+00:00 This is the part of log:
2024-07-17 11:40:19,370 [1] ERROR GssdDesktopClient.Maui.Helpers.UtillHelper - GetDestinations
System.ExecutionEngineException: Attempting to JIT compile method '(wrapper dynamic-method) object object:Thunk1ret_Object_CallSite_Type_Object (System.Func`2<object[], object>,System.Runtime.CompilerServices.CallSite,System.Type,object)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.
at System.Delegate.CreateDelegate(Type type, Object firstArgument, MethodInfo method, Boolean throwOnBindFailure, Boolean allowClosed)
at System.Delegate.CreateDelegate(Type type, Object firstArgument, MethodInfo method, Boolean throwOnBindFailure)
at System.Delegate.CreateDelegate(Type type, Object firstArgument, MethodInfo method)
at System.Reflection.Emit.DynamicMethod.CreateDelegate(Type , Object )
at System.Dynamic.Utils.DelegateHelpers.CreateObjectArrayDelegateRefEmit(Type , Func`2 )
at System.Dynamic.Utils.DelegateHelpers.CreateObjectArrayDelegate(Type , Func`2 )
at System.Linq.Expressions.Interpreter.LightLambda.MakeDelegate(Type )
at System.Linq.Expressions.Interpreter.LightDelegateCreator.CreateDelegate(IStrongBox[] )
at System.Linq.Expressions.Interpreter.LightDelegateCreator.CreateDelegate()
at System.Linq.Expressions.Expression
1[[System.Func
4[[System.Runtime.CompilerServices.CallSite, System.Linq.Expressions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[System.Type, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Compile()at System.Runtime.CompilerServices.CallSite
1[[System.Func
4[[System.Runtime.CompilerServices.CallSite, System.Linq.Expressions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[System.Type, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].CreateCustomNoMatchDelegate(MethodInfo )at System.Runtime.CompilerServices.CallSite
1[[System.Func
4[[System.Runtime.CompilerServices.CallSite, System.Linq.Expressions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[System.Type, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MakeUpdateDelegate()at System.Runtime.CompilerServices.CallSite
1[[System.Func
4[[System.Runtime.CompilerServices.CallSite, System.Linq.Expressions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[System.Type, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].GetUpdateDelegate(Func`4& )at System.Runtime.CompilerServices.CallSite
1[[System.Func
4[[System.Runtime.CompilerServices.CallSite, System.Linq.Expressions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[System.Type, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].GetUpdateDelegate()at System.Runtime.CompilerServices.CallSite
1[[System.Func
4[[System.Runtime.CompilerServices.CallSite, System.Linq.Expressions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[System.Type, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, Publi -
Dani_S 3,786 Reputation points
2024-07-17T11:42:45.8633333+00:00 your quick anwer will be appreciated.
-
Bruce (SqlWork.com) 66,056 Reputation points
2024-07-17T16:16:15.5866667+00:00 Mac catalyst apps must be compiled to native via the AOT compiler server. AOT has limitations, in that the full .net runtime is not supported. emit is the most common missing feature that causes issues. you appear to be using code that uses the emit feature which AOT does not support. lots of libraries (serialization, linq, etc) use emit to generate dynamic code which is faster than reflection. see:
https://learn.microsoft.com/en-us/dotnet/maui/macios/interpreter?view=net-maui-8.0
-
Dani_S 3,786 Reputation points
2024-07-17T16:25:18.9966667+00:00 What do you mean, my code is not supported ? Is connected to how I publish the app ?
-
Dani_S 3,786 Reputation points
2024-07-17T16:31:47.1066667+00:00 What I need to do?
-
Dani_S 3,786 Reputation points
2024-07-17T17:04:03.65+00:00 Linq is basic.
-
Dani_S 3,786 Reputation points
2024-07-17T17:29:31.8866667+00:00 Your quick answer will be appreciated.
-
Bruce (SqlWork.com) 66,056 Reputation points
2024-07-17T21:45:37.0233333+00:00 can't see your code to tell you what is not supported. did you enable the maui interpreter?
https://learn.microsoft.com/en-us/dotnet/maui/macios/interpreter?view=net-maui-8.0
-
Dani_S 3,786 Reputation points
2024-07-18T05:22:54.87+00:00 I used arm64 Did you mean that code <PropertyGroup Condition="'$(RuntimeIdentifier)' == 'maccatalyst-arm64' and '$(Configuration)' == 'Release'"> <UseInterpreter>true</UseInterpreter> </PropertyGroup> what about Intel no need for intererter?
-
Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 32,306 Reputation points • Microsoft Vendor
2024-07-22T01:27:53.4933333+00:00 Try the following:
<PropertyGroup Condition="'$(RuntimeIdentifier)' == 'maccatalyst-arm64' and '$(Configuration)' == 'Release'"> <MtouchInterpreter>-all,MyAssembly</MtouchInterpreter> </PropertyGroup>
Sign in to comment