Debugging under Windows: a couple of issues

I normally test/debug/build under macOS, and then make a .exe for Windows and then test that in Win7/10 VMs. Sometimes, however, there is a need to run in the debugger under Windows, so I make a binary_project and copy the folders of project images and othe resources over. That gives rise to a couple of problems, however:

  1. When I start up the IDE, it can’t find the images and plists etc so it goes through a long sequence of find all these, one by one. I have 105 such items so it takes a while. Is there any way to speed this up? Such as the IDE having me select as folder, and the IDE going through it and matching items in the folder to missing items? As it is, this process takes too long.

  2. When debugging, the IDE creates a Debug folder and deletes it when the session is over. Is there any way to prevent it from deleting the Debug folder? There is some stuff I need to put in there, which is perhaps not best practice but allows me to have identical test-runs under different OSes. I found I can create the Debug folder ahead of time and put my folder in it, but then I have to remember to remove it before quitting the debug session, otherwise it gets deleted along with all the IDE-related items. But I’d like to prevent the Debug folder itself dfrom being deleted.

Sounds like a job for remote debugging.


Remote debugging is a wonderful thing. And for part 2 you should look into Build Steps since you can copy files into you folder/bundle as you need in either debug or final executable builds.

Both are really handy for this exact instance.

1 Like

Every time I have ever seen this stated, the data that is being discussed is better in the ‘Application Support’ folder.
You can put it there on both machines, and it will be there for debug or release versions.
And the OS will allow you to modify it, which you cannot do with files ‘next to the the app when it runs’

The caveat is that you need to put the files there when your app first starts up… either using an installer, or copying from embedded resources, or from unpacking an embedded zip file.

1 Like

Use File > Collect Project Items to gather everything up before the move.

If these are files like DLLs that your program needs, use a Copy Files build step. If it’s data files, go with @Jeff_Tullin 's suggestion and use one of the proper locations for those files, like SpecialFolder.ApplicationData.

Thanks all; Remote Debugging looks very nice. Got it running but done nothing much in anger at this point. Useful to be pushed towards it, however.

Regarding the DebugmyApp folder: the issue there relates to former times when you could more or less put stuff where you felt like it. My app started life as a web app, funnily enough, written in JavaScript and PHP. It was the arbitrary changes made to such as Safari that pushed me towards Xojo. Anyway originally the idea was that a user could put their data and the app on a stick and run it from there, or at least take it with them to move to another machine. Since then I’ve allowed the app to make its own mind up; if it finds itself inside a proper app install location, it reverts to using the user’s Documents folder for the user’s data. To solve my debugging issue, I just make the app do that too when it’s being run in debug mode.

So that’s my two debugging irritations eliminated (for today). :grin:

1 Like