XNA Game Studio 4.0 and PIX for Windows have an unfortunate incompatibility. If you take a PIX capture of a GS4 app using default PIX settings, you will get this error:
Target Program Unexpected Exit
The program ‘foo.exe’ exited unexpectedly while PIX was analyzing it.
To work around this,you must disable D3DX analysis in PIX:
- Launch PIX for Windows
- Select File / New Experiment
- Enter your Program path
- Select A single-frame capture of Direct3D whenever F12 is pressed
- Click More Options
- Switch to the Target Program tab
- Click the Disable D3DX analysis checkbox
- Now click Start Experiment, and PIX will work as expected
The problem occurs because PIX does not support some crazy tricks that GS4 uses to optimize state management. We hope to get this fixed in a future version of PIX, but don’t yet know for sure if/when that will happen, so for now you will have to make do with the above workaround.
My apologies for the inconvenience!