Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. References: Copy Local Property

References: Copy Local Property

Scheduled Pinned Locked Moved ASP.NET
dotnetquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Taurian110
    wrote on last edited by
    #1

    Why is it that whenever we add a reference to a class, the copy local property of that reference is set to TRUE. Why do we need to copy that locally when we are using a Global Class Library? Doesnt that kinda kill the purpose of having a GLOBAL CLASS LIBRARY? If we wanted to add it locally why create a Global Class Library or GAC? I hope you can clerify these as it is very confusing. P.S.: When I change it to Copy Local = False, my app dies with following message: An unhandled exception of type 'System.IO.FileNotFoundException' occurred in MyApp.exe Additional information: File or assembly name GlobalClassLibraryCS, or one of its dependencies, was not found.

    M 1 Reply Last reply
    0
    • T Taurian110

      Why is it that whenever we add a reference to a class, the copy local property of that reference is set to TRUE. Why do we need to copy that locally when we are using a Global Class Library? Doesnt that kinda kill the purpose of having a GLOBAL CLASS LIBRARY? If we wanted to add it locally why create a Global Class Library or GAC? I hope you can clerify these as it is very confusing. P.S.: When I change it to Copy Local = False, my app dies with following message: An unhandled exception of type 'System.IO.FileNotFoundException' occurred in MyApp.exe Additional information: File or assembly name GlobalClassLibraryCS, or one of its dependencies, was not found.

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Taurian110 wrote: Why is it that whenever we add a reference to a class, the copy local property of that reference is set to TRUE. Why do we need to copy that locally when we are using a Global Class Library? In fact, the value of the Local Copy property depends on how you add reference to the assembly. If you simply add reference to another project in the current solution, then the Local Copy is set to True. If you add reference to your assembly from the the Framework SDK folder C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322, or the assembly is found in the GAC, the value of the Local Copy should be false. For more information, you can see CopyLocal property[^] Taurian110 wrote: When I change it to Copy Local = False, my app dies with following message: An unhandled exception of type 'System.IO.FileNotFoundException' occurred in MyApp.exe Looks like the CLR does not know how to load your assembly, you can take a look at the How the Runtime Locates Assemblies[^] to see how to make it work properly.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups