VB.NET Assembly installation on a Network Drive w/COM components

D

David A. Beck

We have developed systems for a client with VB, SQL Server, IIS, and ASP. We
are in the process of doing all new work in .NET. We set up two directories
on a file server. One for the executables and one COM controls. Every use
maps to the
first directory (EXE) to run their programs. When they re-boot their
computer, we have a program in the startup that goes through the second
directory (COM) checking that all the current versions of the COM controls
we need are installed and installing them if they are not. We have home
grown COM components that we can change at will and the executables that use
them don't have to be changed. We would like to do something similar for our
VB.NET programs.

Our home-grown COM controls use other COM controls so re-writing them
comples us to replace the purchased COM conrols with managed code. In some
case we can't do that. We have a problem when we use a COM component in the
VB.NET assembly (DLL). We are told that the VB.NET DLL must be in the same
directory as the VB.NET executable and what's more the executable is locked
into a specific version of the VB.NET DLL. That would mean recompiling every
program that uses the VB.NET DLL when it is changed. Now the catch22, we can
get around the recompiling problem by strongly typing the VB.NET DLL and
putting it in the GAC, BUT you can't strongly type a VB.NET DLL that uses a
COM component.

It would seem that we must leave COM components out of our home grown VB.NET
DLLs.

Is there a different solution or am I incorrect in my assumptions?

David A. Beck
 
P

Peter Huang

Hi David,

Thank you for using MSDN Newsgroup! My name is Peter, and I will be
assisting you on this issue.

Based on my understanding you wants to install an Managed Dll into GAC
which will consume an unmanaged COM object. I think you can achieve this by
generating Primary Interop Assemblies for the COM object, so that you can
put the managed code DLL which using the COM object into GAC.

Here are two article may help you.
Generating Primary Interop Assemblies
http://longhorn.msdn.microsoft.com/lhsdk/ndp/cpcongeneratingprimaryinteropas
semblies.aspx

Registering Primary Interop Assemblies
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconregisteringprimaryinteropassemblies.asp

e.g.
1. tlbimp LibUtil.tlb /primary /keyfile:CompanyA.snk /out:LibUtil.dll

2. regasm LibUtil.dll

3. Using the LibUtil in an strongnamed managed DLL.

If you have any concern on this issue, please post here.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
D

David A. Beck

Peter,

They work, OX just broke the url. I put it together and can now read it.

Dab
 

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