Create COM DLL in VB.net 2005 and use it in VB6.0 PowerPoint Application (Macro Enabled)

I have created a "COM interop" enabled DLL and TLB file in VB.net 2005 and used it in PowerPoint as a reference and it worked fine on the development machine. But on target machine which have .net framework 2.0 it did not worked. I opened the PowerPoint 2007 with security level LOW, and it showed me MISSING reference of the DLL. When I tried to add DLL file it showed me an error "Can't add reference to specif file". I was able to add the .TLB file as a reference and see the list of available functions in it. But when I executed the program it showed me "Automation Error".
<ComClass(Core.ClassId, Core.InterfaceId, Core.EventsId)> _
Public Class Core

Open in new window

Harry_ShanAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

IUFITSCommented:
I did something like this when I needed to use a .Net assembly in a classic ASP web site.  I put my DLL project on CodePlex which has instructions in a text file inside of the project:
http://www.codeplex.com/impersonation/SourceControl/ListDownloadableCommits.aspx
 Here is the text from the documentation I left in that project on how to use it which I believe would apply here also:
--------------------------------------------------------------------------------
Installation Instructions
--------------------------------      
1.)  Run the .Net Framework 'gacutil.exe' on the library file.  The gacutil.exe must be the version that is associated with
  the version of the framework that you compiled the library under:
 
  gacutil /i ComImpersonate.dll
 
2.)  Run the assembly for COM.  I had to use the .Net Framework 2.0's version which worked for the 3.5 library:
  regasm /tlb ComImpersonate.dll
0
IUFITSCommented:
And, I'm guessing the reason that it worked on your development machine was because the IDE registered the library for you (that's my assumption anyway).
0
Harry_ShanAuthor Commented:
I tried using regasm command in RUN window.. it shows me this error screen.

[Window Title]
regasm

[Content]
Windows cannot find 'regasm'. Make sure you typed the name correctly, and then try again.

[OK]

I'm using Windows Vista Ultimate 64 bit operating system. Will that be any problem? However, I've tried the same thing on a Windows XP system... and I got the same error.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Harry_ShanAuthor Commented:
Okay... I found it, I need to use Visual Studio Command Prompt. But how will I do this on client's PC which only have .net framework?
0
IUFITSCommented:
That's a good question.  I actually had to copy it to the target machine (or rather, that was the quickest way I found to fix it).  It wasn't a problem for me because I was deploying it to a server and not to users workstations.  
Now, check this location, it may exist on the client's machine if they have .Net installed:
C:\Windows\Microsoft.NET\Framework\v2.0.50727
You have to user the version specific to the version of the framework you're using (3.0 & 3.5 use 2.0's regasm however, because 3.5 was built off of 2.0, or at least that's the way I've understood it).  In this cause, if it was in the above location you could write a batch file to shell it with the full path.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
IUFITSCommented:
Check this link also, it has some good info:
http://www.thewayofcoding.com/tag/regasm/
 
0
Harry_ShanAuthor Commented:
Thanks a lot for your help. I had deployed the application on my client's PC and it worked.

Once again thanks for all your time and support.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.