Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoiding CopyFilesToOutputDirectory build step

With my C# project in Visual Studio 2010, I noticed that msbuild compiles to a \obj directory, and then copies the files to the real output directory:

CopyFilesToOutputDirectory:
Copying file from "obj\x86\Debug\Manager.exe" to "bin\Debug\Manager.exe".

There is no custom msbuild script, it's all the visual studio defaults. Is there any way to make it build directly to bin\Debug\Manager.exe; circumventing the "CopyFilesToOutputDirectory" step?

like image 643
LTR Avatar asked Apr 05 '12 10:04

LTR


2 Answers

I just wonder why do you want that. There is no easy way since by default obj folder is used when compiling the assemblies (executables and libraries). Only when it is successful the output is copied to bin folder. That is why is visual studio can successfully run the last successful build which is run from bin. So in essential there needs to be obj folder. You can extend the build mechanism, alter and tweak a bit by using this builder and not depending on the default builder by seeing this link

like image 180
nawfal Avatar answered Oct 29 '22 13:10

nawfal


No there isn't, not really anyway. Because the obj folder is holding the temporary (not linked) files during the build.

More reading: What are the obj and bin folders (created by Visual Studio) used for? and here: VisualStudio: How to save the obj folder somewhere else

like image 38
riffnl Avatar answered Oct 29 '22 15:10

riffnl