Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

registered for COM Interop -- installing on another machine

Posted on 2007-11-17
10
Medium Priority
?
487 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 1050 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 450 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 450 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
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.
Screencast - Getting to Know the Pipeline
Suggested Courses

824 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