Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB9.0
Hi!
 
I would like to know more about how the Copy to Output Directory works?
 
Can users implement the property in source code?
 
If so, will it also work on all file types and not just for components and databases?
 

Thanks in advance for your response.
 

JohnPDB
Posted 25-May-12 16:22pm
JohnPDB318
Comments
SAKryukov at 25-May-12 21:58pm
   
What do you mean by "implement the property in source code"? it is already implemented, you can use it...
--SA

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

From the very end: if your mean the project's node property; yes, it works on all files.
"Can user implement the property in source code" — simply makes no sense as you formulate it, if I could understand you correctly, of course. I'll try to explain what you can do.
 
And, finally, I'll try to explain how it works. Please don't blame me if I'm answering a wrong question: you did not explain properly, what kind of property do you mean, so I'll assume that you refer to the property shown, in particular, for the Visual Studio project node. Actually, this is a property of the XML-based standard project file which can be built using the application MSBuild.exe. By the way, this application and C# and VB.NET compilers come for free with the freely re-distributable .NET Framework, so you do not need Visual Studio or any other commercially licensed software tool to build projects; you can even do all the .NET development without Visual Studio. This project format is also valid for Mono (http://en.wikipedia.org/wiki/Mono_%28software%29[^], http://www.mono-project.com/[^]), so it can be used on many non-Microsoft platforms. Visual Studio itself does not build or compile anything; it runs the build utility, most likely through its managed interface available in .NET; you can also do it. You can read about integration of MSBuild with Visual Studio here:
http://msdn.microsoft.com/en-us/library/ms171468[^].
 
The project document has many features; the concept of the property is just one of them. You can write a custom property, among other things, notably — creating custom tasks (please see http://msdn.microsoft.com/en-us/library/t9883dzc.aspx[^], http://msdn.microsoft.com/en-us/library/microsoft.build.utilities.task.aspx[^]).
 
"Copy to Output Directory" is one of the basic properties which causes the file referenced by the project node to be copies to the output directory (which is merely another property, per configuration) as is. This action is, in turn, one of the basic tasks available in the build system. You can use this task if you want to develop a custom project.
 
The build technology based on MSBuild is a very flexible and robust system; it tracks dependencies between files and time stamps which allows for incremental build free from repeated steps and it is very power in terms of customization, compared to "classic" build. Practically, you can create custom tasks and other build-related component in the form of specially interfaced .NET assemblies and easily plug them in the system. You can even use this system to design a build project using the languages and other tools having nothing in common with Visual Studio and Microsoft, and you can do it on non-Microsoft systems (via Mono, for example).
 
You can learn it all starting from this point:
http://msdn.microsoft.com/en-us/library/wea2sca5%28v=vs.90%29[^].
 
For build API, you can start here:
http://msdn.microsoft.com/en-us/library/gg145008[^].
 
—SA
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 25 May 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100