R – Why does Visual Studio copy system assemblies to output folder

build-processvisual-studio-2008

I'm using Visual Studio 2008 SP1 and have an interesting problem. When I build my project System.Trasactions.dll gets copied into output folder (/web/bin). I have actually two questions. First is

  1. Why does Visual Studio copy the file into output folder even when it's not referenced from my project?
    My project has references to other assemblies, that do have a reference to System.Transactions.dll, but none of them has Copy local specified. Why this is a problem, makes the other question:
  2. My operating system is 64 bit, but the System.Transactions.dll comes from 32-bit Framework so the application naturally wont run correctly (actually, it wont run at all. It gives assembly loader error)

Anyone experienced something similar?

Best Answer

  1. If you right click on the reference and then click Properties, the properties window will open. Checking "Copy Local", you'll see that it is set to true. If you don't want it to copy, set it to false.

  2. You said that it comes from the 32 bit framework, can you get a 64bit copy or a msil version?