locked
Questions about adding references to dlls RRS feed

  • Question

  • I'm curious about what happens behind the scenes when an assembly reference is added to a project. I've added a reference to a couple Telerik Reporting assemblies.  Telerik said VS had to be restarted for this to work. This proved true because I struggled trying to get them to work before I found out VS had to be restarted. They worked after I restarted VS though.

    I've used other assemblies like AJAX Control Toolkit that, if I remember correctly for this example, worked immediately without requiring restarting. 

    The Telerik documentation said that these assemblies are added to the Global Assembly Cache.  I'm not very familiar with the GAC.  Given its name though, it seems like other assemblies with references used in the past were probably also added to the GAC without me knowing.

    Are all assemblies included in a project with references always added to the GAC?

    Does VS always need to be restarted if an assembly is added to the GAC?

    • Moved by Tina-Shi Thursday, May 14, 2015 8:56 AM the issue is related to the CLR
    Wednesday, May 13, 2015 7:16 PM

Answers

  • Are all assemblies included in a project with references always added to the GAC?

    Absolutely NOT. 

    GAC stands for Global Assembly Cache. Libraries that are registered trough the gac are presented with a plublic key token and should be strongly signed.

    The main interest of the gac is to centralize dll's identified by their attributes (Version, public key token, etc..)

    DLL's that are part of the GAC and referenced to your project are usualy not copied locally to your application bin folder. They are instead using references from the GAC. And the .NET Jit (just in time) call references from the gac directly.

    Does VS always need to be restarted if an assembly is added to the GAC?

    No.

    When you add an assembly to visual studio you are not required to restart visual studio. Some libraries, however ask for a vstudio restart. I'm not sure of the exact reason but i'm thinking this is probably to allow studio to detect attributes that has impact on any visual designers, wich is the case for a lot of telerik libraries.

    Wednesday, May 13, 2015 8:11 PM