Global Assembly Cache - question

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

    Global Assembly Cache - question

    Hi

    In my solution I have two projects.
    First is Library project.
    The second project uses this library ( dll ).
    I am registering this assembly in global assembly cache ( by .net
    configuration tool ).
    Key pair is generated for the assembly using VS2005 ( I also use VS to
    sign my assembly using this keypair ) Everything works fine.
    I am adding reference to created dll, on the second project.

    Then I need to add some code and rebuild my DLL by right-clicking
    first project/build.
    I have observed that changes are visible for the second project only
    when I register assembly to GAC again.
    Why is that?

    Kind Regards
    Piotr Ko³odziej
  • henk holterman

    #2
    Re: Global Assembly Cache - question

    Piotrekk wrote:
    ....
    The second project uses this library ( dll ).
    I am registering this assembly in global assembly cache ( by .net
    configuration tool ).
    Then I need to add some code and rebuild my DLL by right-clicking
    first project/build.
    I have observed that changes are visible for the second project only
    when I register assembly to GAC again.
    Why is that?

    You don't need to register the Library in the GAC and you probably
    shouldn't.

    Just remove it from the GAC and re-refernce it from the other Project
    using the 'Projects in Solution' tab. Developmont will be seemless.

    If you really want the assembly in the GAC you can do that on deployment.

    -HH-




    Comment

    • Piotrekk

      #3
      Re: Global Assembly Cache - question

      This doesn't answer my question at all. I need this dll to be in GAC
      and I have problem of different kind.

      Comment

      • henk holterman

        #4
        Re: Global Assembly Cache - question

        Piotrekk wrote:
        This doesn't answer my question at all. I need this dll to be in GAC
        and I have problem of different kind.
        Do you really need the assembly to be in the GAC _during_ development?
        In that case the behaviour you see is normal... Maybe you can
        re-register it each build using a build event.


        -HH-

        Comment

        • Piotrekk

          #5
          Re: Global Assembly Cache - question

          Why is that normal?I cannot understand why do I need to register it
          after each build. GAC holds assembly information which doesn't change
          when assembly is rebuilded.

          PK

          Comment

          • henk holterman

            #6
            Re: Global Assembly Cache - question

            Piotrekk wrote:
            Why is that normal?I cannot understand why do I need to register it
            after each build. GAC holds assembly information which doesn't change
            when assembly is rebuilded.
            The Gac holds a copy of your assembly. (Take a look with anything but
            Windows Explorer).

            But why do you think this assembly needs to be in the GAC at all? And
            why during development?

            -HH-




            Comment

            • Alain Boss

              #7
              Re: Global Assembly Cache - question

              Piotrekk schrieb:
              Hi
              >
              In my solution I have two projects.
              First is Library project.
              The second project uses this library ( dll ).
              I am registering this assembly in global assembly cache ( by .net
              configuration tool ).
              Key pair is generated for the assembly using VS2005 ( I also use VS to
              sign my assembly using this keypair ) Everything works fine.
              I am adding reference to created dll, on the second project.
              >
              Then I need to add some code and rebuild my DLL by right-clicking
              first project/build.
              I have observed that changes are visible for the second project only
              when I register assembly to GAC again.
              Why is that?
              >
              Kind Regards
              Piotr Ko³odziej
              The GAC is a special folder where .NET assemblies are stored. If you
              register an assembly in the GAC a copy is stored. Take a look at
              c:\windows\asse mly but do not use the standard windows explorer. use the
              command box instead (or anything else other than windows explorer)
              because the explorer contains an add-in that displays the GAC
              differently from how the files are actually stored.

              The GAC should be used only for assemblies that are used for multiple
              programs (e.g. framework, loggers etc). Usually it is not necessary to
              put your own assemblies in the GAC. However, you should still sign them.

              If you use the assembly in the GAC rather than referencing the DLL in
              the project you have to update the GAC with every change. As Henk told
              you already, it is better to reference the DLL rather than putting it in
              the GAC especially during development.

              Alain


              Comment

              Working...