D'Arcy from Winnipeg
Solution Architecture, Business & Entrepreneurship, Microsoft, and Adoption

Build Issues with Prism Stock Ticker Sample App (Silverlight)

Sunday, March 8, 2009 10:08 PM

Prism is the sexier term for the Patterns and Practices Composite Application Guidance for WPF and Silverlight (You can find out more info and download the components for it here). If you’re going to be doing complex, larger-scale development utilizing Silverlight (or WPF), you should definitely check it out as there’s a great deal of helpful information on how to structure and develop your app.

Setting up Prism is not a turn-key type of operation though. Like other application blocks, you download assemblies and source code that can be used in your applications. Prism comes with a great sample application, but I ran into a couple of issues when I tried to build it.

Unit Testing

The Prism sample application takes advantage of the Silverlight Unit Testing framework. However, the assemblies aren’t included. When you open your solution, you’ll notice the following in all of your test projects:


If you go through the folder structure of wherever you extracted the Prism files to (mine happens to be PrismSource), you’ll find in LIB/Silverlight/UnitTestingFramework a text file which explains that this is the place to put the unit testing DLL’s.


So just download the unit test project from the link above and drop the dll’s into the location.

MSCorLib.dll Version

You may also notice that you’re getting a few of these errors popping up when you try to build:


Depending on the version of Silverlight you have installed you may not have 2.0.31005.0 in your Microsoft Silverlight directory, especially if (like me) you’re working off of a relatively new VM that didn’t have previous Silverlight installations.

To fix this, we need to alter two files located in CAL\Silverlight\Composite.Tests\Mocks\Modules
(Note: Remember that this is in whatever directory you extracted your files to; in my case, PrismSource)


The first file is the createXap.bat file, which is holding a reference to the older version of Silverlight:


The second is the AppManifest.xaml file, which is also looking to the 2.0.31005.0 version:


In both cases I swapped in the version number I had (2.0.40115.0).

Run The App!

After performing both of these sets of tasks, I was able to build the project and run the app.



Technorati Tags: ,


No comments posted yet.

Post a comment