Solved

registered for COM Interop -- installing on another machine

Posted on 2007-11-17
10
483 Views
Last Modified: 2013-12-17
I've written a class in c# that exposes some methods to COM clients.  I've got this working just fine on my own machine.  However, when I deploy my application, the COM goo doesn't seem to work out right.

On the target (installed) machine, I can set a reference to the .tlb (in VB).  And, that appears to make the types available in VB's object browser.  And, I can instantiate the object without seeing an error.  However, when I go to call a method on that object, it throws an error saying, "The system cannot find the specified file".  

I have verified that, when calling the same method from a .Net client on the target (installed) machine, that no such error is generated.  So, I'm thinking that this has to be the interop goo not being able to find the implementation of the type in the .tlb.

My fundamental question is, "What's wrong?  What do I need to do to get this component usable by VB6 on an install machine?"  But, I'll accept specific troubleshooting advice as well.
0
Comment
Question by:dannykrouk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
10 Comments
 
LVL 24

Expert Comment

by:fridom
ID: 20313630
I bet it's some registration problem. The best pages for help probably will be
some below msdn.microsoft.com. If you are near some library you should try to get
.NET and COM Complete Interoperability Guide from Adam Nathan.

Regards
Friedrich
0
 

Author Comment

by:dannykrouk
ID: 20347838
Well, OK.  Perhaps my question, as posed, is not really answerable.  So, let me re-phrase it.

How can I take a class written in C#, which exposes and COM interface, and install it on another machine such that a VB6 application can use it?
0
 
LVL 24

Expert Comment

by:fridom
ID: 20349764
Have you checked the mentioned URLs? Have you checked the mentioned book?

Regards
Friedrich
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

Author Comment

by:dannykrouk
ID: 20351319
Do you mean, have I checked http://msdn.microsoft.com/ (that's the only url I see in your comments)?  I have spent a lot of time there ... and I will continue to do so.  I don't yet have my answer.  So, I guess I'm looking for more specific guidenace.  I have not yet got my hands on the book.  It is a good suggestion.  And, I will look for it.
0
 
LVL 24

Accepted Solution

by:
fridom earned 350 total points
ID: 20356127
Wel I typed in the search
callign a .NET component from a  Com Component and end here:
http://search.msdn.microsoft.com/search/Default.aspx?brand=msdn&locale=en-us&query=calling+a+.net+component+from+a+COM+component

And then I just have to check the first shown entry
http://msdn2.microsoft.com/en-us/library/ms973802.aspx

So I was able to find that ....

Regards
Friedrich
0
 
LVL 1

Expert Comment

by:KrishnaPG
ID: 20369500
Hello,

Use the ProcMon tool from http://download.sysinternals.com/Files/ProcessMonitor.zip to check the exact file that is missing. Then you can easily progress from there on.

All the best.

P.Gopalakrishna
http://www.geocities.com/krishnapg/
0
 
LVL 1

Assisted Solution

by:KrishnaPG
KrishnaPG earned 150 total points
ID: 20369516
Hello,

To answer your other question:
How can I take a class written in C#, which exposes and COM interface, and install it on another machine such that a VB6 application can use it?

You need to do RegAsm for this. On the target machine, run RegAsm.exe on your C# assembly. It will register the COM classes on that machine. (This is similar to the RegSvr32.exe for the native COM dlls.)

Once you have registered with RegAsm.exe everything else is as usual. Just refer that Component in VB and let to create the object :)

All the best.

Yours,
P.Gopalakrishna
http://www.geocities.com/krishnapg/
0
 

Author Comment

by:dannykrouk
ID: 20379717
Well, I see the consensus is converging on strong names and regasm.  I'm working on this now.  At the moment, I'm struggling through some issues with strong names for one assembly not being recognized by the assembly that it depends upon.  Let me work through this and report back.  I think we're on to something here.  Thanks to all for your support.
0
 
LVL 1

Assisted Solution

by:KrishnaPG
KrishnaPG earned 150 total points
ID: 20382143

You can safely ignore the StrongName warning. (Unless this is COM+).

All the best.

Thank you,
P.Gopalakrishna.
http://www.geocities.com/krishnapg/

0
 

Author Closing Comment

by:dannykrouk
ID: 31412389
Thanks to all for your input and support.  In the end, I was able to get an installer to work for this sort of scenario.  However, that did not turn out to be the fundamental problem.  I had failed to correctly handle the differences in paths on the target install machines.  Once I identified that issue, things went much better. :-)
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question