Solved

registered for COM Interop -- installing on another machine

Posted on 2007-11-17
10
477 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

747 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

10 Experts available now in Live!

Get 1:1 Help Now