Visual Studio import plugin

Registered Hydra 6.7.0.1345, Delphi 11, Visual Studio 2022 17.12.4

I’ve created a very simple non-visual plugin in Delphi (probably incorrectly), with just as single function that returns an int as a test. I’d like to import that plug into a C# WPF application/host and toward that end I created a new .NetCore WPF Hydra application, but Extensions | Hydra | Import Plugin interface is grayed out.

Can you advise?

Also, is there an example that shows this case? I’m not finding anything.

Edit, I do have 2 dev machines, one with Delphi and VS2022, and one with just VS2022, and I’ve tried this on both.

Hi,

I can suggest to open Mixed-Mode Sample and try to import delphi unit into any .NET host application (ManagedCSharpHost or ManagedOxygeneHost) .


your interface should be descendant of IHYCrossPlatformInterface and has safecall methods like

unit a;

interface

uses
  Hydra.Core.Interfaces;

type
  ICalculatorPlugin = interface(IHYCrossPlatformInterface)
  ['{59D28E1F-6A47-4C83-82C3-FA55FFF558E4}']
    function Sum(A, B: Integer): Integer; safecall;
  end;
  
implementation
end.

How am I supposed to do this? As I said in my original comment, this seemed to be my core problem in VS2022.

Extensions | Hydra | Import Plugin interface is grayed out.

I have no what ManagedCSharpHost is. It isn’t part of the application created by the wizard in VS2022, and doesn’t show in a Hydra Docs web page search. Entering it in VS and trying to get VS to add the using for it fails - it’s unknown.

Hi,

As I can this menu item works for .NET Framework hosts and doesn’t for .NET Core hosts. I’ll investigate what is wrong.

as a workaround, create .NET Framework host and import your Delphi interface to it. You can use generated file with your .NET Core host

this is a part of Mixed-Mode Sample .

Logged as bugs://H1039.

as a workaround, create .NET Framework host and import your Delphi interface to it. You can use generated file with your .NET Core host

An acceptable workaround, but there appears to be something wrong with the installer - maybe this is related to the .NET Core problem.

When I used the menu in VS2022 and select my .PAS file, it throws this error:

System.IO.FileNotFoundException: Could not load file or assembly ‘Echoes, Version=12.0.0.2942, Culture=neutral, PublicKeyToken=3df3cad1b7aa5098’ or one of its dependencies. The system cannot find the file specified.
File name: ‘Echoes, Version=12.0.0.2942, Culture=neutral, PublicKeyToken=3df3cad1b7aa5098’
at RemObjects.Hydra.CodeGen.CGCSharpCodeGenerator…ctor()
at RemObjects.Hydra.IDE.VisualStudio.IDEIntegrationService.GetCodeGenerator(Project project)
at RemObjects.Hydra.IDE.VisualStudio.PluginImporter.GenerateSourceCode(CGCodeUnit unit)
at RemObjects.Hydra.IDE.VisualStudio.PluginImporter.Import(String filename)

VS suggested enabling logging and when I did it, it gave me this

=== Pre-bind state information ===
LOG: DisplayName = Echoes, Version=12.0.0.2942, Culture=neutral, PublicKeyToken=3df3cad1b7aa5098
(Fully-specified)
LOG: Appbase = file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/
LOG: Initial PrivatePath = NULL
Calling assembly : Silver, Version=12.0.0.2942, Culture=neutral, PublicKeyToken=3df3cad1b7aa5098.

LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\Users\miket\AppData\Local\Microsoft\VisualStudio\17.0_b20436ea\devenv.exe.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Echoes, Version=12.0.0.2942, Culture=neutral, PublicKeyToken=3df3cad1b7aa5098
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/Echoes.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/Echoes/Echoes.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PublicAssemblies/Echoes.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PublicAssemblies/Echoes/Echoes.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/Echoes.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/Echoes/Echoes.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Microsoft/TestWindow/Echoes.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Microsoft/TestWindow/Echoes/Echoes.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Platform/Debugger/Echoes.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Platform/Debugger/Echoes/Echoes.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/DataCollectors/Echoes.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/DataCollectors/Echoes/Echoes.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/DataCollectors/x64/Echoes.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/DataCollectors/x64/Echoes/Echoes.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/Echoes.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/Echoes/Echoes.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PublicAssemblies/Echoes.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PublicAssemblies/Echoes/Echoes.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/Echoes.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/Echoes/Echoes.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Microsoft/TestWindow/Echoes.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Microsoft/TestWindow/Echoes/Echoes.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Platform/Debugger/Echoes.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Platform/Debugger/Echoes/Echoes.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/DataCollectors/Echoes.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/DataCollectors/Echoes/Echoes.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/DataCollectors/x64/Echoes.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/PrivateAssemblies/DataCollectors/x64/Echoes/Echoes.EXE.
LOG: Attempting download of new URL file:///c:/program files/microsoft visual studio/2022/professional/common7/ide/extensions/remobjects software/hydra/1.0/Echoes.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
LOG: Attempting download of new URL file:///c:/program files/microsoft visual studio/2022/professional/common7/ide/extensions/remobjects software/hydra/1.0/Echoes/Echoes.DLL.
LOG: Attempting download of new URL file:///c:/program files/microsoft visual studio/2022/professional/common7/ide/extensions/remobjects software/hydra/1.0/Echoes.EXE.
LOG: Attempting download of new URL file:///c:/program files/microsoft visual studio/2022/professional/common7/ide/extensions/remobjects software/hydra/1.0/Echoes/Echoes.EXE.

I’m guessing the key takeaway from the above text is:

WRN: Comparing the assembly name resulted in the mismatch: Major Version

Looking on my machine I found a plethora of various version of Echoes.dll. Note that one of them is a year newer than the others. Thinking it was related to having either an old trial version or old remoting SDK, I uninstalled everything, deleted everything in Program Files (x86)\RemObjects Software and reinstalled just Hydra, clean. The clean install resulted in multiple different versions of Echoes.DLL again, picture attached below.

The version I installed seems to be 6.7.0.1345, and the two DLL version are 11.0.0.2846 and 11.0.0.2770.

Hi,

I can reproduce this.

as a temporary workaround, I’ve attached required Echoes.dll: Echoes2942.zip (25.2 KB).
Just put it into GAC.

That let me create the interface/import file, but now I’m having a different problem that I think is unrelated. I’ll start a new topic.