Our current system using hydra v6.2 and using non-visual plugins created in dotnet framework for Delphi consumption. This has been working well.
Upgraded to Hydra v6.6 so we could create dotnet 5 plugins.
Installed ok, but none of the existing c# code or Hydra examples would compile. Seems that the GAC does not have the updated (v6.6) remobject dlls - should the Hydra installer do this?
Finally got the dotnet 5 plugin to compile (after registering new Remobject dlls in the GAC), and consuming from Delphi, now getting a runtime error
“Could not load file or assemlby Sytem.Runtime, Version 184.108.40.206”
Is this because I didn’t register the .comhost.dll ?
I tried that and got a registration error
“The module was loaded but the call to DllRegisterServer failed with error code 0x80008093”
Do you have any working examples of Delphi calling a dotnet 5 non-visual plugin?
Yes I had been following the NonVisual Plugins to get things working.
Thanks for the testcase files - after a couple of changes managed to get Delphi calling a dotnet 6 plugin.
Couple of things I just wanted to check
There are some differences calling dotnet 6 plugins to our framework plugins
1/ license.licx doesn’t appear to be required in the dotnet project ?
2/ To load the module in Delphi I can’t use moduleManager.TryLoadModule(‘module.dll’), I have to use moduleManager.LoadComModule(‘’) ? Is this because the COM registration is not automated like it is for dotnet framework?
I also get an error registering the COM dll
eg running $env:systemroot\SysWow64\regsvr32.exe /i PluginSample.comhost.dll
generates an error “The Module PluginSample.comhost.dll” was loaded but the entry-point DllInstall was not found"
Delphi can still load the module via COM, so the registration must have worked.
License Compiler was never ported into the .NET Core world
You can use LoadModule(s)/TryLoadModule methods, but it finally call LoadComModule
function THYBaseModuleManager.LoadModule(const aFileName: string;
const aDefaultDomain: THYClrDomain = hcdNewAppDomain): Integer;
case GetExecutableType(aFilename) of
etCOM: Result := LoadComModule(aFileName);
use regsvr32 w/o /i parameter as described in article
Thanks for all your help - got things going now.
One last thing …
Running the “import interfaces from .NET assemblies” command from Delphi on the dotnet 6 dll imports the assembly interfaces ok, but inherits the interfaces from IHYCrossPlatformInterface
eg IHydraInterface = interface(IHYCrossPlatformInterface)
This creates an access violation in Delphi when trying to call that interface.
I found I had to change it to just IHydraInterface = interface (without the inheritance) to get it to work.
Is this import interfaces command not intended for dotnet core dlls?
Yeah it seems like it is related to dotnet 6 somehow…
I have the exact same dotnet 6 sdk and runtimes installed on the host and VM, both are windows 11 64bit.
Must be some other configuration issue …