Target machine identification (32 bit or 64 bit) when ClickOnce is deployed

I have a Windows Forms application and am deploying this application using ClickOnce deployment. Now I have a third-party DLL file, and it has different versions for the 32-bit and 64-bit OS.

Can I deploy different DLL files based on the target machine (32-bit or 64-bit) through ClickOnce?

+7
winforms deployment 32bit-64bit clickonce
source share
1 answer

[change]

No need to use reflection. You can add a link to your program directly to the bootloader and turn it off. Was there a blog post with the code for this on Tech and Me .

<h / "> You can include both versions in your deployment, but name them differently. Then check the bootloader application, if you are on a 32-bit or 64-bit system, copy the correct dll (for example, thirdparty64.dll → thirdparty.dll), to which your real program is bound, and then call your program from the loader, such as Assembly.Load and use reflection to start your main method.

An easier way is to compile your application as x86, ensuring that it always runs in 32-bit mode. If you do not rely on a specific application installed on a computer in 32/64-bit versions, this may be the best choice.

+3
source share

All Articles