locked
Is the same assembly in design time and runtime? RRS feed

  • Question

  • Hi,

    When I add reference under the .NET tag at design time, I want to know if the runtime also use the same assmebly or the copy in GAC?

    Please clarify me, thanks!


    I am fish.
    Friday, September 9, 2011 8:29 AM

Answers

  • Are you talking about "your custom assembly" or existing ".Net assembly" like "System.Web"?

    If you are talking about custom assembly, when you build application, respective assembly gets copied into output directory i.e. folder in which .exe/.dll is there. It refers the assembly from output directory.

    If you are referencing existing .Net assembly, then all your out of the box assemblies have location in program files and also has the entry in GAC.

    Hope this clears your doubt.

    If not please post detailed description, to understand it better.

     


    Pravin Arote, MCTS - Web Technologies. If reply answers your question, Please mark as Answer :)
    • Proposed as answer by Pravin S Arote Friday, September 9, 2011 10:17 AM
    • Marked as answer by Min Zhu Thursday, September 15, 2011 3:25 AM
    Friday, September 9, 2011 10:17 AM

All replies

  • When you add reference it actually refers the same. When you build your project, referenced assembly gets copied into output directory, it would be the same which you have referenced.

    If your assembly is in GAC, then it will refer from GAC. If your assembly is modified, in this case you need to remove existing assembly and new assembly from GAC. Even you can acheive versioning while deploying the assembly into GAC. This is not case with the private assembly.

    Hope this clears your doubt.


    Pravin Arote, MCTS - Web Technologies If reply answers your question, Please mark as Answer :)
    • Proposed as answer by Pravin S Arote Friday, September 9, 2011 9:13 AM
    Friday, September 9, 2011 9:13 AM
  • Hi Pravin,

    Thanks.

    As we know there is not path for the GAC's assembly. When I add a reference of .NET assmebly, there is a path, so I'm sure the path is not for GAC. As I know, the .NET assemly is also in GAC, so I'm clear about the runtime(which assembly will be loded)?

     


    I am fish.
    Friday, September 9, 2011 9:57 AM
  • Are you talking about "your custom assembly" or existing ".Net assembly" like "System.Web"?

    If you are talking about custom assembly, when you build application, respective assembly gets copied into output directory i.e. folder in which .exe/.dll is there. It refers the assembly from output directory.

    If you are referencing existing .Net assembly, then all your out of the box assemblies have location in program files and also has the entry in GAC.

    Hope this clears your doubt.

    If not please post detailed description, to understand it better.

     


    Pravin Arote, MCTS - Web Technologies. If reply answers your question, Please mark as Answer :)
    • Proposed as answer by Pravin S Arote Friday, September 9, 2011 10:17 AM
    • Marked as answer by Min Zhu Thursday, September 15, 2011 3:25 AM
    Friday, September 9, 2011 10:17 AM
  • Thanks!

    >> then all your out of the box assemblies have location in program files and also has the entry in GAC.

    Would you please tell me the details about it? CSC.exe will use \refenerce switch

    I will mark your reply, it helps.

     


    I am fish.
    Friday, September 9, 2011 10:24 AM
  • Suppose if you are refering "System.Web" in your project. Then its entry would be present in following location "C: \ WINDOWS \ system32\ " and entry would be in GAC. This is the case for all .Net out of the box assemblies.
    Pravin Arote, MCTS - Web Technologies. If reply answers your question, Please mark as Answer :)
    Monday, September 12, 2011 7:01 AM