[AccessD] [dba-VB] VB.Net - using an outside DLL

Shamil Salakhetdinov shamil at users.mns.ru
Wed May 2 15:28:28 CDT 2007


John,

To use gacutil.exe your .NET component classlib assembly has to be signed
using strong name generated by sn.exe utility - did you do that?

Anyway while you're just starting with VB.NET classlibs using local copy is
safe and easy way to proceed now until you get enough experience with sn.exe
and gacutil.exe...

<<<
but that begs the question of
where I am supposed to place this stuff initially in order for that to work
correctly.
>>>
gacutil.exe (see MSDN) installs your assembly in GAC - "installs" means that
it registers it in GAC and also physically copies it there. And GAC can keep
several versions of your components...

When your .NET component is installed in GAC then you can reference it from
your projects.

You can also reference your .NET components without installing them in GAC.

In both cases you can have CopyLocal flag set then you'll get the component
copied on compile/build time into your /Bin (or whatever you call it) folder
where your client (FE/Utility) executable/component is getting built. Then
you can just XCopy this /Bin folder's contents to your customer site.

If you do not use CopyLocal flag and if your have your component registered
locally in GAC and referenced from your client (FE/Utility) project then you
will have to register this referenced component on customer's site using
gacutil. Then your client (FE/Utility) executable/library will find
registered in GAC component on runtime...

Easy... (?!)

Well, not that easy when you will find you wanted to have several versions
of your .NET component installed in GAC and using different versions of .NET
framework etc - all that is possible but should be better avoided as
deployment scenarios in the beginning...

--
Shamil
 
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of JWColby
Sent: Wednesday, May 02, 2007 11:48 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] [dba-VB] VB.Net - using an outside DLL

>- use global version of this components - then you have to register your
classlib .NET component in GAC (Global Assembly Cache) - see sn.exe
(http://msdn2.microsoft.com/en-us/library/k5b5tt23(vs.71).aspx) and
gacutil.exe (http://msdn2.microsoft.com/en-us/library/ex0ss12c(vs.71).aspx)
for more details... 

And there is a batch file in the zip of the component that supposedly
registers this using a gacutil.  Unfortunately I can not get it to to
perform as it is apparently supposed to.  The batch file immediately does a
CD to bin and then tries to execute gacutil but that begs the question of
where I am supposed to place this stuff initially in order for that to work
correctly.  There is no readme.txt that tells me that.


John W. Colby
Colby Consulting
www.ColbyConsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Shamil
Salakhetdinov
Sent: Wednesday, May 02, 2007 3:21 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] [dba-VB] VB.Net - using an outside DLL

John,

If you use your component classlib from within VS (VB.NET, C#, C++/CLI)
applications then you can:

- use local copy of this components with every installation of your FE app,
utility/service app etc.;

- use global version of this components - then you have to register your
classlib .NET component in GAC (Global Assembly Cache) - see sn.exe
(http://msdn2.microsoft.com/en-us/library/k5b5tt23(vs.71).aspx) and
gacutil.exe (http://msdn2.microsoft.com/en-us/library/ex0ss12c(vs.71).aspx)
for more details... 

If you use your COM-exposed .NET component classlib from within COM
application (MS Access, VB6 etc.) then you have to use RegAsm.exe to extract
COM typelib from it and to register it - see MSDN for more details -
http://msdn2.microsoft.com/en-us/library/tzat5yw6(vs.71).aspx 


--
Shamil
 
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of JWColby
Sent: Wednesday, May 02, 2007 10:34 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] [dba-VB] VB.Net - using an outside DLL

I copied this ICSharpCode.SharpZipLib.DLL to my windows\system32 directory
and tried to register it but it gave an error "no load point" or something
similar.  As a result the reference wizard inside of VSS cannot find it in
the list (which probably comes from the registry).  

Aint computin fun?

John W. Colby
Colby Consulting
www.ColbyConsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Eric Barro
Sent: Wednesday, May 02, 2007 11:30 AM
To: dba-vb at databaseadvisors.com; 'Access Developers discussion and problem
solving'
Subject: Re: [AccessD] [dba-VB] VB.Net - using an outside DLL

In VS.NET you create a reference to the DLL and when you compile your
project it puts it in the BIN folder. When you create a setup you specify
all the files it needs and the setup program knows where to copy it on the
target machine. 

I believe I've covered this in a previous email about where .NET stored the
binaries.

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of JWColby
Sent: Wednesday, May 02, 2007 8:21 AM
To: 'Access Developers discussion and problem solving';
dba-vb at databaseadvisors.com
Subject: [dba-VB] VB.Net - using an outside DLL

I am looking at using the ICSharpCode.Sharplib.DLL for its unzip stuff.
This is actually something that is going to go on the server I am building
the project on but might also go on another machine.  My question in general
is where do you place a component like this in the .Net universe?  Do you
place it in Windows\System32 like you would all other DLLs?  Do you place it
in the framework directory?  Do you place it in the project specifically
using it?  
 
Regardless of where you place it, how is it "gathered up, and then
reinstalled" on another machine as a project is migrated to another machine?
 
John W. Colby
Colby Consulting
www.ColbyConsulting.com
 
_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com

 

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list