Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2007

Tip: Looking for answers? Try searching our database.

Basic .Net question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bishman - 17 Jul 2007 12:37 GMT
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.
Francois Malgreve - 17 Jul 2007 13:08 GMT
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.

> Hi,
>
[quoted text clipped - 13 lines]
>
> Jon.
Alex Meleta - 17 Jul 2007 13:29 GMT
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
Francois Malgreve - 19 Jul 2007 04:39 GMT
Hi Alex,

Yes you are right! Sorry I forgot that, I always use VS and never use the
SDK alone.
Thanks to remind me.

Best,

Francois
http://www.malgreve.net

> Hi Francois,
>
[quoted text clipped - 6 lines]
>
> Regards, Alex [TechBlog] http://devkids.blogspot.com
Alex Meleta - 17 Jul 2007 13:19 GMT
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
Bishman - 17 Jul 2007 17:10 GMT
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.

> Hi Bishman,
>
[quoted text clipped - 14 lines]
> Regards, Alex
> [TechBlog] http://devkids.blogspot.com
Larry Smith - 17 Jul 2007 16:25 GMT
> 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
[quoted text clipped - 7 lines]
> 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.
Phil Wilson - 17 Jul 2007 17:45 GMT
"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.
Signature

Phil Wilson
[MVP Windows Installer]

> Hi,
>
[quoted text clipped - 13 lines]
>
> Jon.
Bishman - 19 Jul 2007 16:56 GMT
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 ?

> "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
[quoted text clipped - 20 lines]
>>
>> Jon.
Francois Malgreve - 20 Jul 2007 11:06 GMT
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

> OK....
>
[quoted text clipped - 27 lines]
>>>
>>> Jon.
Cowboy (Gregory A. Beamer) - 18 Jul 2007 19:26 GMT
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.

Signature

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!
************************************************

> Hi,
>
[quoted text clipped - 13 lines]
>
> Jon.
Wardy - 19 Jul 2007 09:31 GMT
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.

................................................................................................................................

> Hi,
>
[quoted text clipped - 13 lines]
>
> Jon.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.