views:

245

answers:

2

I am using the SL unit test framework for tests (http://code.msdn.microsoft.com/silverlightut). My code is heavily client-server communications dependant, and I access the GUI dispatcher in several places to make sure important data is only accessed on a single thread (ie. the GUI thread).

This dispatcher seems unavailable in the unit tests - I have tried using Deployment.Current.Dispatcher and even created an instance of a blank control to try use its own dispatcher, but both don't work. The code inside of Dispatcher.BeginInvoke() just never executes, even if I include a Thread.Sleep afterwards.

A: 

I had to add references to System.Deployment and other testing libraries for Deployment.Current.Dispatcher to work.

It works fine now.

bluebit
A: 

Does such System.Deployment exist? How did you add this reference?

tanya