I have a game written in XNA, and I use ClickOnce installers to distribute the game to testers. I keep once computer as a test machine which does NOT have development environments installed, so that I can test the installed version.

We've found a reproducible bug in our game, but the bug ONLY occurs on the non-development machines that use the ClickOnce installer.

The bug is related to some of our code for moving around 3D objects and is not tied to Networking or GamerServices.

Are there known differences in the ClickOnce runtime and the version on dev? Are there any best-practices for debugging something like this?

  • \$\begingroup\$ It sounds like your bug is in the game and not the installer. What makes you think it's related to the ClickOnce? Have you tried just building the game and copying the files manually? Does the bug still occur in this scenario? If so, it's unrelated to the ClickOnce and you'll have to install some kind of debugger to figure out what's wrong. \$\endgroup\$ – Richard Marskell - Drackir Dec 14 '12 at 5:46
  • \$\begingroup\$ A good way to debug this kind of issue would be to have logs that you can activate on-demand, so when someone faces an issue you can just ask them to activate the logs, reproduce the issue and send you the log file. \$\endgroup\$ – Zonko Dec 14 '12 at 22:40

Have you checked that the assemblies referenced by your program are actually installed via the ClickOnce installer ? It could be that the test machines have this installed by default (such as the XNA Framework) but the non-development machine does not.

A way to check this would be to have a look at your solution and check that all the assemblies that you reference have Copy Local set to True in their properties. Also check the install directory to ensure there are no differences between that which are being installed on the test machines and the non-development machines.

Also as a side note, if the game isn't crashing out completely (as I would imagine it would if it was looking for an assembly that didn't exist) then it could be that the non-development machine is loading an old version of an assembly. Check the machine for any cached versions of those that you use and clean them out.

A final step might be to log onto your non-development machine as a different user. As far as I understand, ClickOnce installs per user rather than per machine, so you might get a 'clean' install if you try that.

  • \$\begingroup\$ thanks! It turned out the problem was that the two computers were rounding floating points slightly differently, but it was helpful to check "Copy Local" so that we felt more assured that the libraries were similar. \$\endgroup\$ – Sean Colombo Dec 15 '12 at 1:10
  • \$\begingroup\$ @SeanColombo please select this as the correct answer if it solved your problem. Thanks. \$\endgroup\$ – ashes999 Dec 15 '12 at 1:38
  • \$\begingroup\$ @ashes999 I don't think it's the correct answer (meaning that if someone searches for the same problem, the answer that i put about floating-point rounding is more likely to help them), but I'd rather give him the points (don't want to give myself points obviously). I'm kinda new here (and more used to wiki systems where you don't really have points) so I'm not sure what the best way to do this is. \$\endgroup\$ – Sean Colombo Dec 15 '12 at 5:58
  • 1
    \$\begingroup\$ @SeanColombo the way it works is you select the right answer as the one that worked for you personally; people will up-vote the ones that worked for them or are "better," so a useful general answer may well bubble up over the accepted answer. It's all good. \$\endgroup\$ – ashes999 Dec 15 '12 at 15:04

In my case, the issue was that floating-point numbers were rounding slightly differently on all of our dev machines versus the two test machines.

Basically -0.9999999999999 vs -1.00000000001, which caused a rotation calculation to be way off. Something to keep an eye out for!

  • \$\begingroup\$ This doesn't really make sense. Even with radians, such a small change shouldn't affect rotation by much. Maybe you should consider using degrees instead, but that'll just hide the problem. \$\endgroup\$ – ashes999 Dec 15 '12 at 15:05
  • \$\begingroup\$ @ashes999 the reason it affected rotation so much is that we passed it into Math.Acos() which returns NaN if the number is < -1. So sometimes it was returning NaN when the number was -1.00000000001, even though logically we wanted the same result as when we passed in -0.999999999. We just added an extra case to change the default value (for when Acos returned Nan) based on the sign of the input. So our result defaults to Math.PI for negative inputs to Acos(), and defaults to 0, for positive inputs to Acos(). \$\endgroup\$ – Sean Colombo Dec 15 '12 at 18:35
  • \$\begingroup\$ Mind providing more details about how exactly You managed to check that? \$\endgroup\$ – Rekin Feb 6 '13 at 22:52
  • \$\begingroup\$ @Rekin I used the debugger on my PC and Xbox and stepped through, very painstakingly and where it started giving differing results (at this Math.Acos() I "watch"ed the variables and stepped through until I found that the numbers were rounded differently & took the execution to different branches of code. \$\endgroup\$ – Sean Colombo Feb 7 '13 at 2:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.