[
https://issues.apache.org/jira/browse/IGNITE-18178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Pavel Tupitsyn updated IGNITE-18178:
------------------------------------
Description:
.NET 7 provides Native AOT capabilities, where the app is published as native
code without dependencies:
https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/
However, if we try to use Ignite.NET in such a scenario, the following error is
produced (both for thin and thick APIs):
{code}
Unhandled Exception: System.TypeInitializationException: A type initializer
threw an exception. To determine which type, inspect the InnerException's
StackTrace property.
---> System.InvalidOperationException: Unable to get memory copy function
delegate.
at Apache.Ignite.Core.Impl.Memory.PlatformMemoryUtils..cctor() + 0x163
at
System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext*)
+ 0xb9
--- End of inner exception stack trace ---
at
System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext*)
+ 0x153
at
System.Runtime.CompilerServices.ClassConstructorRunner.CheckStaticClassConstructionReturnNonGCStaticBase(StaticClassConstructionContext*,
IntPtr) + 0x9
at Apache.Ignite.Core.Impl.Memory.PlatformMemoryUtils.AllocatePool() + 0x9
at Apache.Ignite.Core.Impl.Memory.PlatformMemoryPool..ctor() + 0x20
at Apache.Ignite.Core.Impl.Memory.PlatformMemoryManager.Pool() + 0x36
at Apache.Ignite.Core.IgniteConfiguration..ctor(IgniteConfiguration) + 0x32
at Apache.Ignite.Core.Ignition.Start(IgniteConfiguration) + 0x54
at Program.<Main>$(String[]) + 0x73
at Apache.Ignite!<BaseAddress>+0xfd04bb
Aborted
{code}
Get rid of unnecessary reflection in *PlatformMemoryUtils* to enable native AOT
in user apps.
was:
.NET 7 provides Native AOT capabilities, where the app is published as native
code without dependencies:
https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/
However, if we try to use Ignite.NET in such a scenario, the following error is
produced (both for thin and thick APIs):
{code}
TBD
{code}
Get rid of unnecessary reflection in *PlatformMemoryUtils* to enable native AOT
in user apps.
> .NET: Add support for Native AOT publish
> ----------------------------------------
>
> Key: IGNITE-18178
> URL: https://issues.apache.org/jira/browse/IGNITE-18178
> Project: Ignite
> Issue Type: Improvement
> Components: platforms
> Reporter: Pavel Tupitsyn
> Assignee: Pavel Tupitsyn
> Priority: Major
> Labels: .NET
>
> .NET 7 provides Native AOT capabilities, where the app is published as native
> code without dependencies:
> https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/
> However, if we try to use Ignite.NET in such a scenario, the following error
> is produced (both for thin and thick APIs):
> {code}
> Unhandled Exception: System.TypeInitializationException: A type initializer
> threw an exception. To determine which type, inspect the InnerException's
> StackTrace property.
> ---> System.InvalidOperationException: Unable to get memory copy function
> delegate.
> at Apache.Ignite.Core.Impl.Memory.PlatformMemoryUtils..cctor() + 0x163
> at
> System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext*)
> + 0xb9
> --- End of inner exception stack trace ---
> at
> System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext*)
> + 0x153
> at
> System.Runtime.CompilerServices.ClassConstructorRunner.CheckStaticClassConstructionReturnNonGCStaticBase(StaticClassConstructionContext*,
> IntPtr) + 0x9
> at Apache.Ignite.Core.Impl.Memory.PlatformMemoryUtils.AllocatePool() + 0x9
> at Apache.Ignite.Core.Impl.Memory.PlatformMemoryPool..ctor() + 0x20
> at Apache.Ignite.Core.Impl.Memory.PlatformMemoryManager.Pool() + 0x36
> at Apache.Ignite.Core.IgniteConfiguration..ctor(IgniteConfiguration) + 0x32
> at Apache.Ignite.Core.Ignition.Start(IgniteConfiguration) + 0x54
> at Program.<Main>$(String[]) + 0x73
> at Apache.Ignite!<BaseAddress>+0xfd04bb
> Aborted
> {code}
> Get rid of unnecessary reflection in *PlatformMemoryUtils* to enable native
> AOT in user apps.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)