Monday, May 5, 2008

Game Project In Silverlight

Silverlight Alien Sokoban




Getting Started with Silverlight
To work with Silverlight 1.1 within Visual Studio 2008 Beta 2, one must download the Microsoft Silverlight Tools Alpha. That will add a new item to the Visual Studio project types.



Figure: Silverlight project types in Visual Studio 2008.


Using a Silverlight Project with Other Regular CLR Projects In order to debug Silverlight projects hosted within a non-Silverlight project, such as in our case an ASP.NET web application, we must use the Add Silverlight Link from the Visual Studio Project context menu within the Solution Explorer. Linking to the Silverlight project and hosting it within the ASP.NET project that contains the web service avoids the web service "Cross-Domain problem" that I've heard frequently mentioned.


Figure: Add Silverlight Link in Visual Studio.
Once this is done, files including output assemblies from the ClientBin in the Silverlight project will be automatically copied to your hosting project, and they will be kept in sink when one performs a build. Of course, however, content resources used by your Silverlight project, such as media files, will not be copied, and may require a build event copy task, as show below.

Source Code

No comments: