There are many reasons to install the Enterprise Library into the GAC, they include:
- Component reuse, less duplicity and more consistency
- Performance benefits
- Allows use in other systems such as BizTalk
- Allows you to consistently manage changes throughout your organization
sn -k Microsoft.Practices.EnterpriseLibrary.Data.snk
That will do the Data blocks.
Next you must modify the AssemblyInfo.cs file:
[assembly: AssemblyKeyFile("..\\..\\Microsoft.Practices.EnterpriseLibrary.Data.snk")]
Lastly you have to figure out how you want to distribute your assemblies. While you can create an installer to do it, you will need to create Installer classes to do this as you need to install them into the GAC. I think the most pragmatic approach is a batch file. You can create one batch file to install all the assemblies you choose into the GAC.
gacutil -i Microsoft.Practices.EnterpriseLibrary.Data.dllThis installs the data blocks into the GAC and the pauses so that you can see the results if you want to double-click the file from Windows explorer.
pause
In order to install all of the assemblies into the GAC you can manually do this to all of them or you can script it. I have written a small command line application that I will post later that will recursively setup assemblies to be installed into the GAC and includes all of these steps. If you do this installation manually NOTE: you do not want to install into the GAC any assemblies that end in .Design or any of the tools.
Tom Hollander has also blogged about this subject, you might want to see his comments. He is the Product Manager for Microsoft Patterns & Practices.
No comments:
Post a Comment