views:

614

answers:

2

At first I was just looking for the difference between Resource and Embedded Resource; then I noticed all these other Build Action types: Compile, Content, Embedded Resource, ApplicationDefinition, Page, Resource, SplashScreen, and EntityDeploy.

I understand some of these but some are more vague and a clearcut definition would be helpful in addition to some examples of when you might use each.

Thank you,

+1  A: 

All of the build actions correspond to MSBUILD ItemGroups. If you open your .csproj file in Notepad, you'll see a list of your sources like this:

 <ItemGroup>
    <Compile Include="Accounts._ORMCustomToolReport.cs"/>
    <Compile Include="Class1.cs" />
 </ItemGroup>

There are MSBUILD targets that process the particular ItemGroups in particular ways. In particular, for a C# project, the "Compile" ItemGroup will be compiled by the CSC compiler.

John Saunders
+2  A: 

Compile: Pretty self explanatory. Visual studio should try to compile the code. (cs, vb code files)
Content: Required file for deployment. (ASPX, ASCX pages, Readme files etc.)
Embedded Resource: Embeds the file into the assembly DLL. (nHibernate mappings typically, any sort of content that you don't want to be separated from the assembly)

Spencer Ruport
I'm still interested in learning about the rest of these build actions but this answer summed up what I needed. Thanks.
Nick Gotch
Yeah I couldn't find any explanations that stated clearly what the other build actions were for. Also, apparently you can create your own build actions so depending on what software and plugins you have installed you may see different ones pop up.
Spencer Ruport
There's a related question here with some more details: http://stackoverflow.com/questions/145752/what-are-the-various-build-action-settings-in-vs-net-project-properties-and-wha
Nick Gotch