Reputation: 41
I am a beginner in .Net development. I need to ask about .Net winform deployment. If i have 1 exe file, some class libraries, and 3rd party components (DevExpress). Should i install these Dlls (class library and 3rd party component) in the GAC (Global Assembly Cache) in client computers ? Thank you for the explanations.
Upvotes: 3
Views: 4686
Reputation: 4253
GAC
stands for Global Assembly Cache
any .dll
you place there will be available for all the .net assemblies
'exe' or 'dll'. So if the 3rd party components is something that can/will be used in more then one project then YES you can install in GAC
the best example i can think off is Newtonsoft.Json
But since this is a Windows Form application, when you finish the project you have to pack/deploy somewhere or give it to someone. At that time you can't ask them to install some dlls
in GAC
moreover as per the example above Newtonsoft.Json
yo u are making the Newtonsoft.Json
available for other .Net projects.
Just think why you want to do that instead of thinking about your own app ?
Upvotes: 0
Reputation: 19423
It really depends on a few things, but there's a much better explanation and discussion here:
When should I deploy my assemblies into the GAC?
The verdict (and my personal opinion) is that you never should.
Upvotes: 0
Reputation: 166566
You should be able to do all of this using an Installer Pakage.
Step-by-Step Process of Creating a Setup and Deployment Project
Deploy Windows Applications with Visual Studio.NET
Build Installer Projects for C# Application Deployment
Upvotes: 0
Reputation: 64674
IMO, you should avoid installing these libraries into the GAC. By avoiding the GAC, you make your installation process significantly simpler. In fact, it can get so simple that you can simply copy the bits from one computer to another to do the installation (although you might have other installation constraints that would prevent this).
When you make a reference to a third-party library, you can, in Visual Studio, click on the reference and set the Copy Local
setting to true
. This will copy the library into your bin folder. Third-party libraries will typically install on the developers machine in the GAC, but for deployment you want the system to copy the library into your bin folder.
Upvotes: 2