XNA Essentials

Game Programming for Xbox 360, PC + Windows Phone


Still a Prob with Chapter 3...

Ok, so get this:

I followed your errata, and I tried using the new version of it. I still got errors from it. My first attempt was trying the new version of  Performance Checker .cproj file. The class.cs file was nonexistent. Then, I looked at the amazingly XNA Creators Club site for the CTP fix, and when I opened up my .cproj file the fix was already done, yet I still had the error. Here's my current one after Cleaning and building the solution:


Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'CheckPerformance, Version=, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An
attempt was made to load a program with an incorrect format.
File name: 'CheckPerformance, Version=, Culture=neutral, PublicKeyToken=null'  at XNAPerfStarter.Program.Main(String[] args)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


So.........now what? I'm pretty sure I have my references right. I RMB on the PerfStarter and selected the project tab on the "Add Reference" dialog box. The PerformanceChecker reference was there. I clicked OK.

I still don't know what I did wrong. Could you help me out?

AirStyle120 - Wednesday, June 30, 2010 @ 2:11 PM

Re: Still a Prob with Chapter 3...

I can't reproduce this but the problem definitely exists.

I just did a fresh copy of Chapter3 from the CD onto a new folder on my machine.  I then opened the /Chapter3/XNAPerformanceChecker/XNAPerformanceChecker.sln solution file.  I tried to compile and it gave me the wonder "Chad's an idiot and decided to include a CTP project file" error message.  So I downloaded the zip file from my site and extracted the corrected .csproj overtop of the one in /Chapter3/XNAPerformanceChecker/XNAPerformanceChecker.  Visual C# 2008 Express prompted me with a Reload dialog and I agreed.  After reloading the project I hit CTRL + F5 again to compile and run.  It complained that it couldn't run a dll.  I then set the startup project to XNAPerfStarter instead of the XNAPerformanceChecker that it was referring to.  I hit CTRL + F5 again and it ran successfully.

Don't let this stop you from going on with the rest of the book.  The micro performance testing isn't crucial to the rest of the book.  If you absolutely want it to run and the above doesn't work you can just create a blank solution and add the files manually.  The current machine I'm on is only 32bit.  If you are running 64bit then you may want to make sure you are referencing all of the right assemblies since it seems that is a common problem for the BadImageFormatException.


Chad Carter - Wednesday, June 30, 2010 @ 10:52 PM