Main Site Documentation

Debug works fine, Relase has problems


I have been messing with my webserver project and it has been working fine. This whole time i have been messing with it i have been in debug mode. I just switched to release and tried it and it gets hosed up. Any ideas why this would be happening ?


Found the problem, shocked too.

It goes back to this thread about using Debug.Print

Some said that it was ok to keep them in there in release mode if want to. so being a bit lazy i did not put the following everywhere i wanted to see something

 #if DEBUG

Instead i just put Debug.Print(“bla…bla…bla…”);

So now i went to release mode and it got hosed up.

I then went back and used Wouter Huysentruit idea to put this in

 #if DEBUG
using Microsoft.SPOT;

Then i used Architect’s idea and added the method

static void DebugPrint(string text)
    #if DEBUG

Then changed all my Debug.Print’s to DebugPrint.

Now it works just fine in release mode.


That’s a bit odd; never had anything break in release because of a debug line. And Microsoft.SPOT does more than Debug so I’d pretty much always keep that using :wink: