Development for 64-bit and 32-bit

I read a lot about the transition from 32-bit to 64-bit. I use a lot of equipment for suppliers and finally got both 64-bit and 32-bit drivers for each. Moving from 32 to 64 seems like an easy transition.

The problem, however, is that we do not want to "cross over". We want to support both, side by side, without the need to duplicate the code base for each modification that we perform. And “we,” I mean “I,” since I'm the only developer, and he would effectively reduce my productivity by a third to duplicate the changes.

I understand that for a simple C # application, I can just compile a version that will work regardless of architecture and be able to do this. However, I do have a disconnect in determining how to handle the drivers and libraries that I use. I think it would be trivial to simply write 2 different installers, each of which installs the appropriate drivers, but how can I refer to these DLLs in the application? If I refer to 32-bit drivers, but install 64-bit drivers, I get errors that the libraries I cannot find. Trying to refer to both does not fix things, as it will always be absent.

How can I handle this correctly? I would like ideas both on the installation side (I have the right to use two separate installers) and how to correctly refer to DLLs to allow this.

+3
source share
5 answers

The best solution, as Reindinen suggests: let the installer handle this.

- 32- 64- DLL , , SetDllDirectory API. p/invoke DllImport "SomeLib.dll", SetDllDirectory . \Lib32 .\Lib64 . , , , Main.

+2

.dll DLL 64- 32- , ? , , NTFS, 32- 64- DLL .

+1

ScottHanselmans " : 32- 64- x86 x64 .NET Framework CLR".

, , .

, : ( , ) Dependency Injection - , N-Tier?

0

, , Microsoft , , 2 , IDE, installshield, .

Installshield , Installsheild . 2 , 32 64, , , , , 32-, 32 .

Btw, Windows, , , , 64- . , , , 32- .

0
0

Source: https://habr.com/ru/post/1768666/


All Articles