Solved

registered for COM Interop -- installing on another machine

Posted on 2007-11-17
10
478 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
  • 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
 

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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
I have been scripting applications way too long and can never remember how to create an ISS file.  So I decided to write this article to act as my own knowledge base for future reference, and hope you will also benefit. An ISS file is a response …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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.

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now