Balder in Windows Phone 7

Oct 18, 2010 at 9:54 PM
Edited Oct 18, 2010 at 10:30 PM


I am trying to utilize balder in windows phone 7 and not having any luck.  I followed the tutorial here:  It's not windows 7 but it seemed close enough.

I cannot seem to get past the very first part and my guess is that I am missing something easy although I cannot seem to find what it is.....

1.  Created new silverlight project for windows phone 7 using VS2010 Express for Windows Phone.

2.  Add reference to balder.dll and ninject.dll (I do get a popup here that says adding a referenct to silverlight may cause problems, seemed strange but oh well).

3.  Add the namespaces to MainPage.xaml


xmlns:Execution ="clr-namespace:Balder.Execution;assembly=Balder"

4.  Add the execution:game to the content Grid in MainPage.xaml


Execution:Game Width="400" Height ="400" />

5.  build works

6.  try to run it and get this exception, ""The GraphicsDevice must not be null when creating new resources.\r\nParameter name: graphicsDevice"".

Any ideas?

I also tried downloading and compiling the Balder.WP7.TestApp.  It fails with a "Not Supported" exception on this line of the App.xaml.cs file:

static App() {

Balder.Display.WP7.Display .Initialize();


If I comment that line out I get the same exception in #6.

Thanks for your help!

Oct 19, 2010 at 4:29 PM


you need that last line of code in your point 6. - odd that you get that exception. 
That line of code is the only thing that differs the Silverlight version and WP7.

Which version of the WP7 tools are you using?

Is it possible for you to try out the following project : - which uses Balder on WP7. If that fails I will need to get a clean machine with the same setup as you. 

Oct 20, 2010 at 1:01 PM

Thanks for your help!  I downloaded the RubiksCube code, everything compiled fine, deployed to the emulator successfully, and then I get an exception on that same line of code:  Balder.Display.WP7.Display .Initialize();

I am using Visual Studio 2010 Express for Windows Phone.  There is one thing I forgot to mention, my graphics card does not support DirectX 10.  I could not create an XNA project for windows phone because of this which is why I was trying to get Balder to work because it was rendering with Silverlight.  As part of the second exception, if I comment this line of code out, I see some XNA namespaces.  So now I am wondering if the 'NotSupported' is coming from the DirectX runtime?

Anyway, I am more than happy to help you troubleshoot, please let me know what else I can do.


Oct 20, 2010 at 3:46 PM

That comes as a relief to me - not very comforting for you, though. :)

The thing is that Balder uses XNA, even though it is a Silverlight based application for the Windows Phone. So I guess you need a DX10 graphics adapter to make it work.

Oct 21, 2010 at 3:25 PM

Thanks for your help.....the graphics card must be the problem then.  I did try some of the normal silverlight applications (non-windows phone) and they work as expected.


thanks again!

Nov 15, 2010 at 11:43 PM


I have received the same message as dourada.

""The GraphicsDevice must not be null when creating new resources.\r\nParameter name: graphicsDevice""

but my graphic card Quadro FX 8800M supports DirectX 10.

any idea?

thanks Filip


Nov 16, 2010 at 10:25 AM

Could you email me your project?  einar [at] dolittle [dot] com.


Nov 24, 2010 at 7:04 PM

I have the same problem. I have a macbook with a Nvidia 9600M. Its possible do anything to make these work?

Nov 24, 2010 at 7:38 PM

Are you running in BootCamp or trying to run in a virtual environment?

Nov 24, 2010 at 8:14 PM

@adept I'm running via Bootcamp in Windows 7 32bits.

Nov 25, 2010 at 7:29 AM

Have you tried creating a standard Windows Phone 7 XNA App?  

If that works, could you please send me your project to einar [at] dolittle [dot] com 

Nov 25, 2010 at 4:58 PM

XNA App seems to work fine.

My code is here:

I try it in a PC with windows 7(not mac hardware) and I have the same problem. I folowed the Rubik's Cube for Silverlight and Windows Phone 7 to do these. I have used the WP7 version of balder.dll and ninject.dll.

Nov 25, 2010 at 6:03 PM

You're missing the required call in App.xaml.cs  :

Balder.Display.WP7.Display .Initialize();

If you go to the end of the article, you see you need to add it in the Launching and Activated event.


Hope that helps. 

Nov 25, 2010 at 9:06 PM

Thanks alot!!! :)