Problems registering assembly for COM

P

Phil

VB2005
I have created a class library project.
I have created a class using the COM class template.
In the Application tab under My projects if I click on Assembly Information,
the 'Make assembly COM-visible' box is checked.
In the Compile tab the 'Register for COM Interop box is checked.
In the Signing tab the 'Sign the assembly' box is checked, and I have
created a .snk file.
The Delay sign only box is not checked.
I have built the project and checked that I can reference and use it from
VBA project on my machine.
I have copied the dll onto another machine and issued the following command:

regasm mydll.dll /tlb:mydll.tlb /codebase

This appears to run successfully.

When I try to use the dll from a VBA project on this machine, I can add the
reference OK, and it shows up in the object browser, but when the code runs
I get an error saying that the assembly or one of it's dependencies cannot
be found.

Any ideas?
TIA
Phil.
 
W

Walter Wang [MSFT]

Hi Phil,

Based on my experience, such error is usually caused by some dependent
assemblies cannot be loaded by your assembly. You can either use Reflector
(http://www.aisto.com/roeder/dotnet/) to open your assembly and see which
referenced assemblies are missing or you can use Assembly Binding Log
Viewer (fuslogvw.exe)
(http://msdn2.microsoft.com/en-us/library/e74a18c4(VS.80).aspx) to know
which assemblies are failing to load.

Hope this helps.


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Phil

Based on my experience, such error is usually caused by some dependent
assemblies cannot be loaded by your assembly. You can either use Reflector
(http://www.aisto.com/roeder/dotnet/) to open your assembly and see which
referenced assemblies are missing or you can use Assembly Binding Log
Viewer (fuslogvw.exe)
(http://msdn2.microsoft.com/en-us/library/e74a18c4(VS.80).aspx) to know
which assemblies are failing to load.

Thanks, There shouldn't be any dependencies other than the standard VB
runtime stuff, as I haven't added any references in this project. Other VB
applications have been installed on that machine in the past, so I assumed
everything needed would all be there already.
I expect if I build a proper deployment package it will work, but this was
just a quick test to see if I can access some of my code from VBA. It would
have been much easier and quicker to simply recompile my code in VB6, but I
shall persevere with the new more complicated ways of doing the simple
things in .NET.

Cheers,
Phil.
 
W

Walter Wang [MSFT]

Have you tried the Assembly Binding Log Viewer, maybe it could give us some
clue.


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top