Basic .Net question

B

Bishman

Hi,

I have been digging around for info on the deployment of a .Net DLL. There
doesnt seem to be an equivalent of Regsvr32 for a .Net DLL. Is this correct
? Am I right in saying that what I need to do is get the Assembly registered
in the GAC ? I can do it using .Net Framework 2.0 Configuration from the
Administrative tools but this is not command line based and doesnt reside on
an XP pro machine.

I thought that maybe Gacutil.exe may be the answer but I dont think so.

Can someone point me in the right direction as I need to deploy a .Net DLL
that is shared accross several Forms apps.

Thanks.

Jon.
 
F

Francois Malgreve

Jon,

gacutil.exe is the command line utility to deploy .Net assembly (dll) into
the GAC. check out gacutil /? in a command line prompt for information about
how to use it.

Nevertheless, it is shipped with Visual Studio, not with the .Net
Framework.

What about taking the gacutil.exe and gacutil.exe.config from VS and copy
them on the machine you need to run it? This might just work for you.

Hope this help.

Francois.
 
A

Alex Meleta

Hi Bishman,

B> Can someone point me in the right direction as I need to deploy a
B> .Net DLL that is shared accross several Forms apps.

If you need to simply share your assembly between several applications then
GAC is the way:
Use (if you need the command line only):
gacutil.exe /i assembly.dll to add an assembly into the GAC
gacutil.exe /u assembly.dll to remove it from there

(More commands: http://msdn2.microsoft.com/en-us/library/ex0ss12c(VS.71).aspx)

Be sure the assembly is strong named before it's to be added to the gac.

Regards, Alex
[TechBlog] http://devkids.blogspot.com
 
A

Alex Meleta

Hi Francois,

FM> Nevertheless, it is shipped with Visual Studio, not with the .Net Framework.

Not exactly.
..net framework SDK contains it, but .net framework redistributable is not.
VS package just contains .net sdk.

Regards, Alex
[TechBlog] http://devkids.blogspot.com
 
L

Larry Smith

I have been digging around for info on the deployment of a .Net DLL. There
doesnt seem to be an equivalent of Regsvr32 for a .Net DLL. Is this
correct ? Am I right in saying that what I need to do is get the Assembly
registered in the GAC ? I can do it using .Net Framework 2.0 Configuration
from the Administrative tools but this is not command line based and
doesnt reside on an XP pro machine.

I thought that maybe Gacutil.exe may be the answer but I dont think so.

Can someone point me in the right direction as I need to deploy a .Net DLL
that is shared accross several Forms apps.

Yes, you would need the GAC for this but I strongly recommend getting hold
of "Programming .NET Components" by Juval Lowy. He wears a number of
different hats including "Microsoft's Regional Director for the Silicon
Valley". He's one of the world's foremost authorities on .NET and it's
self-evident IMO (the moment you start to browse his book). It covers
everything you need to know about this and many other issues. Even seasoned
..NET developers can learn a thing or two.
 
B

Bishman

Alex,

Thanks for the reponse.

So in summary, would I be right in saying that MS dont really want
assembly's to be deployed this wayand that they would prefer the user to
write an installer for it ?

I only assume this as gacutil.exe is not native to a Windows system in the
same way that Regsvr32 is ?

Thanks again.
 
P

Phil Wilson

"assembly registered in the GAC" is one of those ambiguous phrases where I
never know what people are asking. If you just want it deployed into the
GAC, that's just a plain install into the GAC. The term "registered"
implies registration (as in COM registration) so if you really really mean
that you want the equivalent of regsvr32 for .NET assemblies, then
regasm.exe is what registers them for COM clients, and they can be in the
GAC or not.
 
C

Cowboy \(Gregory A. Beamer\)

Depends on what you are looking for.

If you want a global assembly, the GAC is the correct tool. If, instead, you
want a COM registered assembly, you can use regasm.exe and both GAC and
register it.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************
 
W

Wardy

Bishman,

As long as the client has the framework on the machine they are trying to
execute the .NET assembly i cant see a problem.

I often just build apps then email to friends who just open up the files and
run the executable.

The windows installer is meant to do the hard work like that hense the use
of an installer project found in most desktop app projects.

Web applications just have the assemblies live in the bin folder, nothing
else needs doing.

.................................................................................................................................
 
B

Bishman

OK....

Refering to Phils reply "...If you just want it deployed into the
GAC, that's just a plain install into the GAC.. " this is what I want.

My question would then seem to be how do you deploy into the GAC ?


Phil Wilson said:
"assembly registered in the GAC" is one of those ambiguous phrases where I
never know what people are asking. If you just want it deployed into the
GAC, that's just a plain install into the GAC. The term "registered"
implies registration (as in COM registration) so if you really really mean
that you want the equivalent of regsvr32 for .NET assemblies, then
regasm.exe is what registers them for COM clients, and they can be in the
GAC or not.
--
Phil Wilson
[MVP Windows Installer]

Bishman said:
Hi,

I have been digging around for info on the deployment of a .Net DLL.
There doesnt seem to be an equivalent of Regsvr32 for a .Net DLL. Is this
correct ? Am I right in saying that what I need to do is get the Assembly
registered in the GAC ? I can do it using .Net Framework 2.0
Configuration from the Administrative tools but this is not command line
based and doesnt reside on an XP pro machine.

I thought that maybe Gacutil.exe may be the answer but I dont think so.

Can someone point me in the right direction as I need to deploy a .Net
DLL that is shared accross several Forms apps.

Thanks.

Jon.
 
F

Francois Malgreve

I know 3 different ways of deploying a .Net assembly into the GAC.

1. Through windows explorer, drag and drop the dll into C:\WINDOWS\assembly
2. Through the "Microsoft .NET Framework 2.0 Configuration" (found under
Administrative Tools)
3. Through a command line utility called gacutil.exe which is NOT delivered
with the .Net framework redistributable but with the .NET SDK. So, you will
need to have either the .Net SDK or Visual Studio installed on the machine
you want to deploy the assembly. Visual Studio indeed includes the SDK as
Alex Melata reminded me in a previous post.

- to install an assembly in the GAC : gacutil /i myAssembly.dll
- to remove an assembly from the GAC: gacutil /u myAssembly.dll

Please run gacutil /? for more details.

If you still can't have it working, Make sure you use a command prompt from
Programs-> Microsoft .NET Framework SDK v2.0 -> SDK Command Prompt
As that link initialize the command prompt with the necessary variables set
(PATH and so on).

If you want to deploy your assembly through a batch file, your batch file
should include the necessary path, to make it easy, just include in the
beginning of your batch file the commands found in "C:\Program
Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sdkvars.bat"

I hope this help so that you can finally deploy your assembly.

Best,

Francois Malgreve
http://www.malgreve.net




Bishman said:
OK....

Refering to Phils reply "...If you just want it deployed into the
GAC, that's just a plain install into the GAC.. " this is what I want.

My question would then seem to be how do you deploy into the GAC ?


Phil Wilson said:
"assembly registered in the GAC" is one of those ambiguous phrases where
I never know what people are asking. If you just want it deployed into
the GAC, that's just a plain install into the GAC. The term "registered"
implies registration (as in COM registration) so if you really really
mean that you want the equivalent of regsvr32 for .NET assemblies, then
regasm.exe is what registers them for COM clients, and they can be in the
GAC or not.
--
Phil Wilson
[MVP Windows Installer]

Bishman said:
Hi,

I have been digging around for info on the deployment of a .Net DLL.
There doesnt seem to be an equivalent of Regsvr32 for a .Net DLL. Is
this correct ? Am I right in saying that what I need to do is get the
Assembly registered in the GAC ? I can do it using .Net Framework 2.0
Configuration from the Administrative tools but this is not command line
based and doesnt reside on an XP pro machine.

I thought that maybe Gacutil.exe may be the answer but I dont think so.

Can someone point me in the right direction as I need to deploy a .Net
DLL that is shared accross several Forms apps.

Thanks.

Jon.
 

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