1

I have a Console application and a Class Library in a solution. Whenever I reference class library from console application it finds it but after building the solution it cannot find the type.

Although CopyLocal is set to true but the referenced assembly is not copied !

ohmantics
  • 1,799
  • 14
  • 16
Xaqron
  • 29,931
  • 42
  • 140
  • 205

2 Answers2

5

The reason was my console application target framework was Client Profile. Changing it to .NET 4.0 resolved the problem.

Xaqron
  • 29,931
  • 42
  • 140
  • 205
4

Is the referenced assembly in the Global Assembly Cache? Assemblies that are installed in the GAC are not copied to the output folder, even when CopyLocal is true.

Iridium
  • 23,323
  • 6
  • 52
  • 74
  • No. It's an assembly of mine. I checked folder security and permission is granted. – Xaqron May 15 '11 at 17:13
  • You can also turn up the MSBuild logging level through the Visual Studio configuration which may indicate why the referenced assembly is not being copied. – Iridium May 15 '11 at 17:20
  • This solves mine issue, is there any opportunity to copy assembly even though it's in GAC? – Johnny_D Oct 05 '12 at 15:15
  • It would also be interesting to know which application installed it in the GAC (http://stackoverflow.com/questions/7861155/how-to-tell-which-applications-have-a-given-assembly-registered-in-the-gac). – Wernight Jul 12 '13 at 14:11