0

I am currently training a junior engineer in this job I have been working on for several years. It is in C# under Visual Studio and has one solution with several projects under it.

One of the projects generates an application, and when I debug that project on my PC it works fine. On the other hand, when he does the same it raises an exception, because a reference does not find the file it is supposed to.

We have ascertained that this is because said reference has CopyLocal at True on my PC and False on his. I assume there is a way to fix this in Visual Studio settings since we use SVN to make sure all our files are the same (and we checked that the relevant node in both our .csproj files is indeed the same).

I have looked here and there, but cannot find how to fix his settings. Can anyone help me with that, please?

Thanks a lot, and have a nice day!

jdl_sopra
  • 91
  • 1
  • 9

1 Answers1

0

The reference that has CopyLocal set to false is most likely in the GAC on your junior engineer's PC but not your own. The default value is determined by the set of rules below. Removing it from the GAC should solve the problem.

See: Set "Copy Local" to False by default?

(Taken From MSDN)

  1. If the reference is another project, called a project-to-project reference, then the value is true.
  2. If the assembly is found in the global assembly cache, the value is false.
  3. As a special case, the value for the mscorlib.dll reference is false.
  4. If the assembly is found in the Framework SDK folder, then the value is false.
  5. Otherwise, the value is true.
Community
  • 1
  • 1
BenDoingCoding
  • 166
  • 1
  • 8