locked
about private and shared assembly RRS feed

  • Question

  • while i m writng shared  assembly prog the dll file sud not be copied in recent project's debug folder....it becomes private assembly
    Wednesday, September 19, 2012 7:36 AM

Answers

  • Even though your assembly is in the GAC, you still have to add a reference to it in your application in VS.NET. When you reference your assembly, it's not being used as a private assembly, even though you might think it is.

    To make things easier on the developer, you usually store a copy of your
    strongly-named dll in a folder like c:\program files\common files\[component
    name]\

    Then, in VS.NET, you reference this assembly. However, at run-time, .NET
    checks the global assembly cache when it needs to resolve the assembly
    location first. It finds it there, and uses it.

    To prove this, you can look at the properties window of the referenced dll
    in VS.NET, and you will see that the "Copy Local" property is "false",
    meaning that it knows your assembly is strongly-named and installed in the
    GAC, causing it to not be copied to your application's private path when
    compiled.

    If you do not want it to copy locally then make the copy local false if it is true.

    Let me know if this resolves your confusion and mark it as helpful for others to help?


    Mark it as helpful if so!!! thanks, Mithilesh

    • Marked as answer by pradeep007 Thursday, September 20, 2012 3:03 PM
    Wednesday, September 19, 2012 8:02 PM

All replies

  • Your requirement is not clear, please be specific what you are doing and what you expect?

    BTW to make an assembly shared you have to make it strongly typed and then copy it into GAC, so other application can access it from there.


    Mark it as helpful if so!!! thanks, Mithilesh

    Wednesday, September 19, 2012 9:16 AM
  • actually i m doing a prog on shared assembly...(i have done all the requirements---strong name casting,registering to GAC folder....so the dll file is present in GAC FOLDER)...and in another project i want to use the dll folder..so i hv done all the required steps.

    as a shared assembly the dll file should not be copied in to debug folder of another project..but it was copied to it aumatically..why??

    (which is only possible in case of private assembly)

    so my confusion arises..why it happens...if u plz understand my problem,then make me understand ..tell the solution

    Wednesday, September 19, 2012 4:37 PM
  • Even though your assembly is in the GAC, you still have to add a reference to it in your application in VS.NET. When you reference your assembly, it's not being used as a private assembly, even though you might think it is.

    To make things easier on the developer, you usually store a copy of your
    strongly-named dll in a folder like c:\program files\common files\[component
    name]\

    Then, in VS.NET, you reference this assembly. However, at run-time, .NET
    checks the global assembly cache when it needs to resolve the assembly
    location first. It finds it there, and uses it.

    To prove this, you can look at the properties window of the referenced dll
    in VS.NET, and you will see that the "Copy Local" property is "false",
    meaning that it knows your assembly is strongly-named and installed in the
    GAC, causing it to not be copied to your application's private path when
    compiled.

    If you do not want it to copy locally then make the copy local false if it is true.

    Let me know if this resolves your confusion and mark it as helpful for others to help?


    Mark it as helpful if so!!! thanks, Mithilesh

    • Marked as answer by pradeep007 Thursday, September 20, 2012 3:03 PM
    Wednesday, September 19, 2012 8:02 PM