Thursday 25 March 2010

Visual Studio Build Actions Property

Each file within a .Net project has a build action property for specifying the build action on the file when a build is executed. Typically the buld action will be one of these:

  • None - The file is not included in the project output group and is not compiled in the build process. An example is a text file that contains documentation, such as a Readme file.
  • Compile - The file is compiled into the build output. This setting is used for code files.
  • Content - The file is not compiled, but is included in the Content output group. For example, this setting is the default value for an .htm or other kind of Web file.
  • Embedded Resource - This file is embedded in the main project build output as a DLL or executable. It is typically used for resource files.

However, this is not the definitive list as the build action property is extensible.

The default build action property set by Visual Studio is set according to the extension of the file that you add to the solution.

e.g. a Class.cs file would get a build action of compile as it's a code file - simples :)

No comments:

Post a Comment