2

I have deployed a 64-bit COM+ application and while trying to create an instance of it via script, it fails with no error message and a negative error code (-2146233036).

The script:

 dim myObj on error resume next set myObj = CreateObject("TestApp.1") 

 if (Err.number <> 0) 
     then MsgBox Err.Number & " " & Err.Message 
 end if 

 if (myObj is nothing) 
     then MsgBox "Null" else   MsgBox "Not Null" 
 end if

Essentially I was trying to troubleshoot of why CoCreateInstanceEx was failing for the same. How do I find out what happens behind the scene? At which step is it failing?

MikroDel
  • 6,389
  • 7
  • 37
  • 69
Karthik
  • 62
  • 3
  • How did you register the COM+ component? – Kane Nov 27 '12 at 09:28
  • The HRESULT seems to indicate that you have a COM callable wrapper around a .NET component - http://social.msdn.microsoft.com/Forums/da/clr/thread/2a8770ad-102b-4e7a-b9d4-4a6e3a0b0678. Unfortunately, there could be a huge number of reasons for failure – StuartLC Nov 27 '12 at 09:35
  • Kane, I registered using regsvcs.exe, the one present under Framework64 folder. I can see the entries under 64 bit hive in registry. – Karthik Nov 27 '12 at 10:10
  • @Stuart. Yes that's right. It is a managed library deployed as COM+ component. However it is not registered in GAC. – Karthik Nov 27 '12 at 10:18
  • @Stuart. I tried to invoke via managed console application. It does throw, "Type constructor threw an exception". – Karthik Nov 27 '12 at 10:29
  • @Karthik - you possibly need to post your .NET class code. Also, if you haven't gac'ed it, you will need to use use [regasm /codebase](http://stackoverflow.com/questions/1873919/register-managed-assemblies-with-com-without-using-the-gac) – StuartLC Nov 27 '12 at 11:02
  • @Stuart - It's a huge one. By the way, I got what the issue is. It was looking for an assembly signed with key A, whereas the one in GAC is signed with key B. This assembly is created from a managed C++ project. Now the other issue I have is, the assembly generated when the project is compiled, is not signed. That is because in the linker, command line option has /DELAYSIGN, which is read-only window. How do I change it? I am trying to build and register that assembly again into GAC_64. – Karthik Nov 28 '12 at 10:09
  • 1
    @Stuart - No worries. I figured it out. I had to change it under Linker->Advanced->Delay Sign->"No". Things fell in place. The assembly is now strongly named and registers into GAC_64. – Karthik Nov 28 '12 at 10:21

0 Answers0