Open frenchfish opened 9 months ago
Hi. Currently NativeAOT lacking of support for Com servers. The link https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.comwrappers.getorcreateobjectforcominstance?view=net-8.0 which you gave to me in email, does not the help with createion of COM server.
If you brave enough, you can create DLL where you export nescessary functions 'DllGetClassObject' at minimum and implement IClassFactory
you can do the trick.
You can see how it was done in managed profiler.
https://github.com/kevingosse/ManagedDotnetProfiler/blob/master/ManagedDotnetProfiler/DllMain.cs
https://github.com/kevingosse/ManagedDotnetProfiler/blob/master/ProfilerLib/ClassFactory.cs
Be careful, since all marshalling between COM datatypes and .NET datatypes you have to do yourself.
https://github.com/kevingosse/ManagedDotnetProfiler/blob/master/ManagedDotnetProfiler/DllMain.cs
https://github.com/kevingosse/ManagedDotnetProfiler/blob/master/ProfilerLib/ClassFactory.cs
Be careful, since all marshalling between COM datatypes and .NET datatypes you have to do yourself. Thanks. Great tip
Hello do you know how to make Comobject in Native AOT (which will be used in native )