Skip to navigation
Real World Computing

Managing assemblies

Posted on 20 Mar 2006 at 12:18

Thomas Lee delves deeper into the world of .NET assemblies and their deployment management in the enterprise

-a--- 2/5/2006 2:25 PM 4096 maths2.dll

[C:\PCPRO]:

If you were now to run the client application, it wouldn't use this new DLL, however, because it was compiled to use the older DLL with a lower version number. If you've been following the examples in this article, when you run client.exe, .NET loads the maths.dll that was installed into the GAC. To get redirection to the new DLL to happen, you must first create the publisher policy file maths2redirect.cfg as follows:

publicKeyToken="c4d402178c81336a"

culture="neutral"/>

newVersion="1.1.1.101"/>

Then you 'compile' this policy file using the AL (Assembly Linker) tool from the .NET SDK and install the compiled file into the GAC, as follows:

C:\PCPRO>al /link:Maths2Redirect.cfg /out:Policy.1.1.Maths2.dll /keyfile:pcpro.snk /version:1.1.1.101

C:\PCPRO>gacutil /i Policy.1.1.Maths2.dll

Assembly successfully added to the cache

Once this has been done, when you next run client.exe the .NET CLR reads the publisher policy and loads the proper, later version of maths.dll.

In this column, I've looked at the GAC and provided a simple example demonstrating how to use it. Publisher Policies allow you to redirect calls to subordinate assemblies to a new version to enable updates to be issued securely for library DLLs, say to solve a security flaw. Next month, I plan to look at performance issues and some things you can do to improve the performance of .NET applications.

1 2 3 4 5
Be the first to comment this article

You need to Login or Register to comment.

(optional)

advertisement

Most Commented Real World Articles
Latest Real World Computing
Latest Blog Posts Subscribe to our RSS Feeds
Latest News Stories Subscribe to our RSS Feeds
Latest Reviews Subscribe to our RSS Feeds

advertisement

Sponsored Links
 
SEARCH
SIGN UP

Your email:

Your password:

remember me

advertisement


Hitwise Top 10 Website 2008
 
 

PCPro-Computing in the Real World Printed from www.pcpro.co.uk

Register to receive our regular email newsletter at http://www.pcpro.co.uk/registration.

The newsletter contains links to our latest PC news, product reviews, features and how-to guides, plus special offers and competitions.