Thursday, February 6, 2014

My computer is fixed and the WP7 XNA workaround

So, after two days I finally fixed my computer and reinstalled my development tools on it. The computer whose hard disk broke down was my development computer. The lesson learned here is, "backup early, backup often." Whatever the case, in order to get XNA working again, I had to use an interesting workaround.

I don't know why this error happens, but it does. When you try to run a XNA project (using VS2010) when you have VS2013 installed, it gives the following errors:

There are four steps to fix this:
1) Close Visual Studio and go to C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
2) Copy devenv.exe.config to your desktop, and open it in notepad.
3) Add this block of code to the bindings block in the file:

< dependentAssembly>
  <assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
  <bindingRedirect oldVersion="" newVersion=""/>
< /dependentAssembly>

4) Copy the new devenv.exe.config file you edited to replace the old one.

This will fix your XNA WP7 projects and get rid of the errors. The reason it errors out, is that Visual Studio is trying to use the 2013 version of the MS Buld Framework, that overwrites the VS2010 one and comes with Visual Studio 2013.
What we do here is when you open Visual Studio 2010, it will redirect the "old" new VS2013 one that doesn't work with WP7 to the VS2010 that works with WP7.

1 comment: