For pedagogical reasons, or to build a code generator (like Perspective Fx does), it may be useful to compile Silverlight code on the command-line. Last year, I wrote an article for Silverlight 2.0 about this subject. I have adapted it today to Silverlight 3.0.

The main differences are at the paths :

  • libraries path (/lib compiler option, .rsp file),
  • MsBuild Microsoft.Silverlight.CSharp.targets task path (.proj file).