VS2K3 doesn't copy file reference
-
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
-
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
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
-
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
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).
-
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).
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