Silverlight: Build Actions

Resources, embedded resources, content and all the other options! It’s just confusing! So I hope to outline the build actions so you can choose the best one to suit your needs

Silverlight Build Actions

Silverlight build actions defined:

  • None – Does exactly what it says on the tin (well textbox). The resource file will not be a part of the .xap.
  • Compile – This build action is reserved for .cs and .vb files and should not be used for other items.
  • Content – Item will be included in the application package (.xap) without it being embedded it in the project assembly.
  • Embedded Resource – This build action is aimed at non-Silverlight action. Should be changed to a build action of Resource
  • ApplicationDefinition – This build action is reserved for the app.xaml file which defines the start point for your Silverlight application.
  • Page – This build action is given to certain types of Xaml based files like user controls and pages. Mainly used with Silverlight navigation applications.
  • CodeAnalysisDictionary – Unknown.
  • Resource – The file is embedded into the application assembly. The resource is accessible using a relative Uri, relative to the Xaml file from where they are being referenced.
  • SplashScreen – Is for WPF applications only and is explained perfectly here.
  • EntityDeploy – is used by the ADO.NET Entity Framework.

Resource files and their related BuildAction alternatives are explained here.

If you have any comments or thoughts why not start a thread at Silverlight Forums?