The reason for my slightly odd question is simple. I'd like to run my console as 32-bit on my dev box simply because of the convenience of edit-and-continue, which can be a time-saver for silly mistakes - just fix them on the spot and go on.
But I'd also like not to have to change the build configuration, because it's under source control and I'll forget to set it back to "any cpu" and we'll end up deploying the wrong image version if I set this to "x86".
Is there a way that let's me get the best of both worlds?
In the end, I opted for the following solution:
Add a new console app project to my solution called 32bitLauncher. Set the build configuration on this one to target x86 only. Then make my various batch classes and their main methods public, and define multiple entry points in the launcher, like this:
class Prefill
{
static void Main(string[] args)
{
PrefillBatch.Main(args);
}
}
class Correspondence
{
static void Main(string[] args)
{
CorrespondenceBatch.Main(args);
}
}
Now I can select the startup object in the property pages for the launcher when I want to switch between batches, actually more convenient than changing the startup project (because I anyway need to go into the property pages to set command-line arguments). This forces 32-bit execution even on 64-bit hardware, and lo and behold, I can edit-and-continue!