Open Spacefish opened 6 months ago
So i tried to use RocksDbSharp in a AoT published project today and it didn´t work.
Looked at the code, and yes makes sense, as it emits the IL to call into the native shared objects during runtime, so that won´t work :)
.NET 9.0 we will have AssemblyBuilder.DefinePersistedAssembly see https://github.com/dotnet/runtime/pull/97177 AssemblyBuilder.Save(...) see https://github.com/dotnet/runtime/issues/97015 and https://github.com/dotnet/runtime/issues/92975
AssemblyBuilder.DefinePersistedAssembly
AssemblyBuilder.Save(...)
So maybe with .NET 9.0 the wrapper arround the native shared object can be pre-generated into IL during build-time and AOT should work?
So i tried to use RocksDbSharp in a AoT published project today and it didn´t work.
Looked at the code, and yes makes sense, as it emits the IL to call into the native shared objects during runtime, so that won´t work :)
.NET 9.0 we will have
AssemblyBuilder.DefinePersistedAssembly
see https://github.com/dotnet/runtime/pull/97177AssemblyBuilder.Save(...)
see https://github.com/dotnet/runtime/issues/97015 and https://github.com/dotnet/runtime/issues/92975So maybe with .NET 9.0 the wrapper arround the native shared object can be pre-generated into IL during build-time and AOT should work?