MSBuild tasks for build machines for WPF and Silverlight

6 במרץ 2008

אין תגובות

[This blog was migrated. You will not be able to comment here.
The new URL of this post is http://khason.net/blog/msbuild-tasks-for-build-machines-for-wpf-and-silverlight/]


Silverlight got go-life, so we should start preparing automatic build machines for new Silverlight projects. Actually, it is not too complicated, however, there are some new tasks should be taken into account.

  • Output type of any Silverlight application is Library
  • New XML node specializing the output type of the library: SilverlightApplication with True value
  • Another XML node, that specializing the output file type XapOutputs with True value. XAP is, actually, ZIP archive of all assemblies, used within the application.
  • XAP file name can be set with XapFilename property
  • We can decide whither create Silverlight manifest file or not with GenerateSilverlightManifest tag (true)
  • The template of the manifest for generation resides in SilverlightManifestTemplate tag, so you can specify the path to xml file for manifest generation 
  • The entry point of your application should be set with SilverlightAppEntry property, that specifying the name of class (for most cases it will be $(AppName).App)
  • You can tell the enviroment to generate test web page, hosting your Silverlight control by specifying CreateTestPage=true
  • If you decided to generate test file, you should specify the test page name by setting TestPageFileName

There are some new constants for compile conditions

  • DebugType – the type of debug symbols. Instead of general "full", you should specify "pdbonly" value.
  • NoStdLib defines inclusion of standard libraries with the project (kind of "always copy"). Default = true (not include)
  • NoConfig defines inclusion of config data. Default = true (not include)

Reference set for standard Silverlight application is

  • System.Windows
  • mscorlib
  • system
  • System.Core
  • System.Xml
  • System.Windows.Browser
  • System.Windows.Controls

Those are not standard .NET classes, but special Silverlight dlls, resides in \Program Files\Microsoft Silverlight directory

You can also include your own references by setting Private node of Reference to true. Here the example of such include for Silverlight Extended controls

<Reference Include="System.Windows.Controls.Extended">
<Private>True</Private>
</Reference>

ItemGroup section is rather standard, except of new node SilverlightPage (uses standard MSBuild:CompileXaml generator.

That's all, folks. Happy build machines to you.

הוסף תגובה
facebook linkedin twitter email

כתיבת תגובה

האימייל לא יוצג באתר. שדות החובה מסומנים *