strong naming assemblies

J

Jason

I've been experiementing with
Assembly.Load..CreateInstance
and strong naming the assemblies. This has given me a few
questions,

1. Does the version number matter? I've found that its the
public key token that controls whether the assembly is the
right one. Changing the version number did not have any
affect.

2. When I build my solution (2 strong named assemblies), I
need to include the <Runtime> information in the config
file. If that is left out, and I rebuild the solution with
different public key tokens, the strong named assemblies
are loaded every time i.e. its the <Runtime> element that
actually determines which "copy" of the assemblies to load.

Apologies for any ignorance this message reveals!!
 
P

Parker Zhang [MSFT]

Hi Jason,

To answer your question about whether or not the version number matters, it
depends on what type of assembly you have. If your assembly is a strong
named assembly then it will matter. If this strong named assembly is
deployed to the GAC, you will be able to load different versions by
specifying the different version numbers. If the strong named assembly is
in the local folder as opposed to the GAC, you can only load it using one
version by specifying the correct version number or by just ignoring the
version number. This is assuming that all the assemblies have the same
PublicKeyToken.

Based on my understanding, you think that only the <Runtime> element can
actually determine which "copy" of the assemblies to load. However, a fully
qualified assembly name within Assembly.Load's arguments can also specify
which version of the strong named assembly that you want to load in your
application.

If you have any Qs, please reply to this post.
 

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