Search code examples
c#.netdll64-bit32bit-64bit

Requirement of 64-bit version DLLs in a .NET project


Introduction

I'm working on a .net project, in which I'm using some 32-bit version DLLs. The list of DLLs are:

  1. System.*
  2. Microsoft.*
  3. AWSSDK.*
  4. Npgsql.dll
  5. Newtonsoft.Json.dll
  6. Some other dlls from other vendors

(The list of DLLs is actually too long to be attached in this post without making it too long.)

Requirement

I require 64-bit version DLLs only and at the moment, I only have 32-bit version DLLs in our hand.

Things that I have tried

I verified the DLLs' version using a tool named SigCheck.

I tried to find/convert the DLL version using the following methods:

  1. I searched on the internet and NuGet Package Manager but, I was not able to find 64-bit DLLs.
  2. I tried recompiling the project to 64 bit by changing below setting under project properties: - Build -> Platform Target -> x64

After compilation, the project DLL got converted to 64-bit. However, the remaining project DLLs' version didn't change.

Question

I would be grateful if someone could share documentation links/steps to convert 32-bit version DLLs to a 64-bit version?

or

Could someone please send us a link to find recompiled 64-bit version of the given DLLs?

Please note that I'm using .NET framework 4.6


Solution

  • Managed .Net dlls are usually platform agnostic. So for most of the libraries you do not need to worry about it, just use nuget to refer to the libraries and you should be good to go. The JIT compiler will take care of compiling the assemblies to 64/32 bit depending on the platform.

    The platform target you specify when compiling a dll only sets a flag in the dll. This flag can be changed with CorFlags, but if it has a 32-bit flag it might be for a reason.

    The big problem usually occurs when you need to use native assemblies (i.e. c++ dlls). These need to be platform specific. The best solution is to get 64-bit versions of these DLLs, but you would need to get them from the vendor of the libray and update the references in your projects. The most common workaround if you can not get a 64-bit version is to run the library in a separate 32-bit process.