当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - How to implement conditional compilation ti run application on 32 bit and 64 bit platform?

问题描述:

I have 32 bit .net application solution project. It uses many third party dlls (32 bit). This app runs on both 32 bit and 64 bit (as a 32 bit process, compatibility mode) platform. It uses 32 bit DLLs even if it is running on 64 bit platform. I need to rebuild this application in order to let it use/load 32 bit Dll on 32 bit OS and use/load 64 bit DLLs on 64 bit OS.

As existing 32 bit app runs on 64 bit systems in compatibility mode but I want it to be run as a dedicated 64 bit app on 64 bit System.

One possible way is to create two different soltuions for 32 bit and 64 bit using corresponding DLLs. But I want to modify my existing solution in such a way so that it builds the exe which installs/loads 64 bit dlls on 64 bit systems and 32 bit DLLs on 32 bit system. There are several projects in the soltuion which reference these third party DLLs(32 bit). These Dlls have identical names for 32 and 64. So i can not reference both of the DLLs in any project. Someone suggested to use conditional compilation but I am clueless. Please suggest some way.

分享给朋友:
您可能感兴趣的文章:
随机阅读: