strong naming assemblies

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jason

    #1

    strong naming assemblies

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

  • Parker Zhang [MSFT]

    #2
    RE: strong naming assemblies

    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.

    --
    Parker Zhang
    Microsoft Developer Support

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Comment

    Working...