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. General Programming
  3. C#
  4. VS2K3 doesn't copy file reference

VS2K3 doesn't copy file reference

Scheduled Pinned Locked Moved C#
helpquestion
4 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.
  • C Offline
    C Offline
    CBoland
    wrote on last edited by
    #1

    I'm having a problem in VS2K3 whereby a file reference of a project reference isn't being copied to output folder upon compilation. Here's the solution structure: ProjectA References Assembly1.dll (File reference; CopyLocal = True) ProjectB References ProjectA (Project reference; CopyLocal = True) After compiling: ProjectA's output folder contains: ProjectA.dll Assembly1.dll ProjectB's output folder contains: ProjectA.dll ProjectB.dll (but not Assembly1.dll) Has anyone seen or resolved this? Craig Boland

    H 1 Reply Last reply
    0
    • C CBoland

      I'm having a problem in VS2K3 whereby a file reference of a project reference isn't being copied to output folder upon compilation. Here's the solution structure: ProjectA References Assembly1.dll (File reference; CopyLocal = True) ProjectB References ProjectA (Project reference; CopyLocal = True) After compiling: ProjectA's output folder contains: ProjectA.dll Assembly1.dll ProjectB's output folder contains: ProjectA.dll ProjectB.dll (but not Assembly1.dll) Has anyone seen or resolved this? Craig Boland

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      Select the reference under the References node and look at the properties. There is a property to control whether the assembly is copied to the target directory. If the assembly with the same name (name, version, culture, and public key token) is installed into the GAC, you should not copy the assembly to the target folder since the CLR checks the GAC first. If the property is set to copy the assembly, then check your compiler warnings. Many times a file may be in use and cannot be copied from its source directory (or if the destination is in use, it can't be copied over). The only fix is to restart VS.NET and try again.

      Microsoft MVP, Visual C# My Articles

      C 1 Reply Last reply
      0
      • H Heath Stewart

        Select the reference under the References node and look at the properties. There is a property to control whether the assembly is copied to the target directory. If the assembly with the same name (name, version, culture, and public key token) is installed into the GAC, you should not copy the assembly to the target folder since the CLR checks the GAC first. If the property is set to copy the assembly, then check your compiler warnings. Many times a file may be in use and cannot be copied from its source directory (or if the destination is in use, it can't be copied over). The only fix is to restart VS.NET and try again.

        Microsoft MVP, Visual C# My Articles

        C Offline
        C Offline
        CBoland
        wrote on last edited by
        #3

        Heath, Thank you for taking time with my question. All references, as stated in the problem definition, are set to CopyLocal=True, yet indirect dependencies (references of references) are not copied, at least not file references. Looking at the various projects in my solution, I see the Project references are linked to the 'obj' folder of the referenced project. Now I wonder when dependencies are copied and how they are determined, because this process seems to miss the indirect file references. Interestingly, however, the Deployment projects do a more exhaustive search along the dependency hierarchy because it finds many related files. My solution uses MS Commerce Server and some of the projects have two dozen or so dependencies, most of which don't need to be deployed because Commerce Server is a product pre-installed on the target machines. While writing this reply, I created a small sample project to illustrate my point. In the sample, App1.exe has a project reference to ProjRef1.dll. ProjRef1 has a file reference to FileRef1.dll (which is not part of the solution) and, naturally, it works correctly. Maybe there's a problem with the size of my solution (30 projects).

        H 1 Reply Last reply
        0
        • C CBoland

          Heath, Thank you for taking time with my question. All references, as stated in the problem definition, are set to CopyLocal=True, yet indirect dependencies (references of references) are not copied, at least not file references. Looking at the various projects in my solution, I see the Project references are linked to the 'obj' folder of the referenced project. Now I wonder when dependencies are copied and how they are determined, because this process seems to miss the indirect file references. Interestingly, however, the Deployment projects do a more exhaustive search along the dependency hierarchy because it finds many related files. My solution uses MS Commerce Server and some of the projects have two dozen or so dependencies, most of which don't need to be deployed because Commerce Server is a product pre-installed on the target machines. While writing this reply, I created a small sample project to illustrate my point. In the sample, App1.exe has a project reference to ProjRef1.dll. ProjRef1 has a file reference to FileRef1.dll (which is not part of the solution) and, naturally, it works correctly. Maybe there's a problem with the size of my solution (30 projects).

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          Doubtful - I managed a 60+ project solution for builds, many of which have indirect dependencies. Again, check your build output window for warnings about files being in use. This is most often the problem.

          Microsoft MVP, Visual C# My Articles

          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