11

I have a c# project which use an internal vb project as COM.

When I converted the project to VS 2010 the following line Throw me an exception:

Set RTCClient_ = New RTCCORELib.RTCClient

the RTCCore.RTCClient is part of Microsoft Merge Module for RTC (RTC Client API 1.2) that you can embedded into your installation package (That in my case includes the EXE).

the RTCCore.RTCClient is the class that is being registered to registry under HKEY_CLASSES_ROOT\RTCCore.RTCClient

The error I'm getting is:

ERROR: Automation error
The specified module could not be found. (-2147024770)

But If I'm changing my csproj and using ToolsVersion="2.0" the above line works and I can get RTCClient object.

What seems to be the problem?

Dor Cohen
  • 16,769
  • 23
  • 93
  • 161
  • 1
    may you show how do you call your COM object from C# – cnd Sep 20 '12 at 08:29
  • I think there's some information missing from your question. Please clarify what RTCCORELib.RTCClient is; confirm whether the VB project itself implements a COM server; and explain the role of the C# project and how it relates to this VB code specifically. – Chris Dickson Sep 20 '12 at 08:39
  • "confirm whether the VB project itself implements a COM server; and explain the role of the C# project and how it relates to this VB code specifically" - I still don't see this in your edited question. – Chris Dickson Sep 20 '12 at 09:08
  • 1
    My crystal ball says: "Remove `On Error Resume Next` from that code so you'll get a proper diagnostic" – Hans Passant Sep 20 '12 at 09:16
  • 2
    The ball is still talking: "That's error code 0x8007007E, a Windows error code. It means 'file not found' when trying to load a DLL". Lots of reasons why a DLL could not be found, a typical reason is forgetting to use the /codebase option when you run Regasm.exe to register the C# assembly. You can use SysInternals' ProcMon utility to see where it is looking for the DLL. – Hans Passant Sep 20 '12 at 10:35
  • @HansPassant My 8-ball telling me that my question is why in ToolsVersion="2.0" my code succeed to create the object and in ToolsVersion="4.0" it failed, what is the difference – Dor Cohen Sep 20 '12 at 11:03
  • 1
    @DorCohen If you suspect there is some difference in the build process between "2.0" and "4.0" you can change, in Visual Studio 2010, the output verbosity (for example to "Diagnostic") via "Tools -> Options -> Project and Solutions -> Build and Run -> MSBuild project build output verbosity". – Alessandro Jacopson Sep 21 '12 at 15:17
  • How is your internal VB project related if the RTCCore library is provided by Microsoft? – Holistic Developer Sep 30 '12 at 21:37
  • @DorCohen Can you try setting the useLegacyV2RuntimeActivationPolicy in the application's app.config and see if it helps? : http://msdn.microsoft.com/en-us/library/bbx34a2h%28v=vs.100%29.aspx – Ganesh R. Jan 20 '13 at 06:10

1 Answers1

1

Try setting Embed Interop Types to false in the properties of the reference to your COM library in the project. Mine is C#, but your VB.Net may have it as well.

Properties window

user195275
  • 1,039
  • 13
  • 18