I'm not actually using the packager, I'm using the SQL Toolkit API to generate the compiled packaged output from some of my own code. I am however using the (slightly modified) template solution that comes with the packager for the output.
What I'm trying to get to the bottom of is whether the standard packager output has an issue with 64 bit, or whether it is specific to the modified template solution I am using.
I've tried some tests with differing results:
Using the modified template solution as a base, I used my code to generate a C# .exe file. This will run fine on 32 or 64 bit with compression disabled, and on 64 bit with compression disabled, but crashes on 64 bit with compression enabled.
Using the modified template solution as a base (ie. replacing the one in C:\\Program Files\\Red Gate\\SQL Bundle 5\\SQL Packager Code Templates\\C#), I used the Red Gate SQL Packager version 18.104.22.168 to generate a C# .exe file. This will run fine on both 32 or 64 bit with compression disabled or enabled.
It seems that something in the way the PackagerEngine.Package() method compiles the output causes this issue.