Using a 32 bit dll on a 64 bit machine

10,298

Your 32 bit dll should work just fine on a 64 bit machine as long as it is loaded into a 32 bit process - attempting to load a 32 bit dll into a 64 bit process will fail.

If your project is a .Net (e.g. C#) application then you should be able to target your assembly at x86 in order to get your 32 bit dll working correclty:

  • Right click on your project in Visual Studio and select Properties
  • On the Build project properties tab ensure that the Platform target drop down reads "x86" instead of "Any CPU"

If you platform target is "Any CPU" then your project will normally be targeted at whatever platform is available, i.e. x64 on a 64 bit OS - this will prevent your 32 bit dll from being loaded.

If your project is not a .Net assembly then the equivalent steps needed to do the above will be different.

Alternatively you can attempt to obtain a 64 bit version of your dll - if it is a dll that you have produced then you will need to migrate it to 64 bit yourself. If not then you are dependent on the original suppliers providing a 64 bit compatible version.

Share:
10,298
Nhuren
Author by

Nhuren

Updated on June 08, 2022

Comments

  • Nhuren
    Nhuren almost 2 years

    I have an old project which uses a 32 bit dll. This works fine on 32 bit processor, however when I install the same project on a 64 bit OS it does not work.

    Is there any way to convert 32 bit dll to 64 bit? Is there an alternative solution solution to make my 32 bit dll work in a 64 bit OS?