Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do .NET developers offer 32-bit/64-bit versions of .NET assemblies?

Tags:

.net

jit

64-bit

Evey now and then I see both x86 and x64 versions of a .NET assembly. Consider the following web part for SharePoint. Why wouldn't the developer just offer a single version and have let the JIT compiler sort out the rest? When I see these kinds offering is it just that the developer decided to create a native image using a tool like ngen in order to avoid a JIT?

Someone please help me out here, I feel like I'm missing something of note.

Updated

From what I got below, both x86 and x64 builds are offered because one or more of the following reasons:

  1. The developer wanted to avoid JITing and created a native image of his code, targeting a given architecture using a tool like ngen.exe.

  2. The assembly contains platform specific COM calls and so it makes no point to build it as AnyCPU. In these cases builds that target different platforms may contain different code.

  3. The assembly may contain Win32 calls using pinvoke which won't get remapped by a JIT and so the build should target the platform it is bound to.

like image 404
Tyler Avatar asked Jan 17 '09 23:01

Tyler


People also ask

Why do people go from 32BIT to 64bit?

Simply put, a 64-bit processor is more capable than a 32-bit processor because it can handle more data at once. A 64-bit processor can store more computational values, including memory addresses, which means it can access over 4 billion times the physical memory of a 32-bit processor.

Is .NET 32 or 64-bit?

NET Framework 1.0 or 1.1 are treated as 32-bit applications on a 64-bit operating system and are always executed under WOW64 and the 32-bit common language runtime (CLR). 32-bit applications that are built on the . NET Framework 4 or later versions also run under WOW64 on 64-bit systems.

Why is 32BIT Better than 64bit?

As its name suggests, the 32 bit OS can store and handle lesser data than the 64 bit OS. More specifically, it addresses a maximum of 4,294,967,296 bytes (4 GB) of RAM. The 64 bit OS, on the other hand, can handle more data than the 32 bit OS.

Should I use 32-bit or 64-bit programs?

Do I Need 64-Bit Windows? For most people, 64-bit Windows is today's standard and you should use it to take advantage of security features, better performance, and increased RAM capability. The only rare reasons you'd want to stick with 32-bit Windows are: Your computer has a 32-bit processor.


1 Answers

If they are using specific non-.Net API, then there may be two code bases for this, a perfect example is COM controls.

ngen is also another very good reason for this as you mentioned.

like image 110
Tom Anderson Avatar answered Sep 24 '22 23:09

Tom Anderson