Convert .net applications from 32 to 64 bits

I have a .net application,

  • Class Library (target platform installed on any processor )
  • Winform application (target platform installed on any processor )
  • Installer (target platform installed on X86 and detected dependencies installed for .net framework (x86))

Now, when I install this application through setup.exe on a 64-bit machine, it is installed in the Program Files [x86] folder; I assume this is a WoW64 function to emulate a 32-bit environment in a 64-bit application.

Now that the client asks to convert it to 64-bit, why does it matter to him if the 32-bit version itself works fine through WoW64? converts it to a 64-bit result in performance?

And when I try to convert it to 64-bit, I need to change it for everyone, i.e.

  • Class Library (change target platform to 64) (What if I skip this step?)
  • Winform application (change target platform to 64) (What if I miss this too?)
  • Installer (change the target platform to 64). [A specific list of dependencies does not show any .NET framework x64, why?]

Please offer.

+6
source share
4 answers

No conversion is required, your application is already running as a 64-bit process. Because you used AnyCPU in the EXE project. You installed it in the wrong folder, but it does not really matter if no other process tries to start your programmatically. This is extremely rare.

Check this on the Processes tab of TaskMgr.exe. A 32-bit process has * 32 after its process name.

Make your client happy by changing the TargetPlatform setting on the installation project to x64 so that it is installed in c: \ program files. Spends a few minutes.

+7
source

You can leave the .NET code projects on AnyCPU, however, to install on a 64-bit version without using 32-bit WOW material, you need to change the installer project property that you mentioned.

If you have custom actions in the installer, they may not work when you switch to 64-bit. You can get a BadImageFormatException . To solve this problem, you need to encounter the resulting MSI:

http://adamhouldsworth.blogspot.com/2010/10/64bit-custom-actions.html

This will not make much difference to the client if your application is standalone. When upgrading to the 64-bit version of the free performance boost, in addition to accessing more operating systems, (although JIT has various types of optimizations).

The only situation I encountered when you need a 64-bit cue ball is when you consume this DLL in another application, you cannot mix the bit in one process.

Update: perhaps the lack of a 64-bit infrastructure requirement is due to the fact that you are using VS 2005?

http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/7b00f4e9-64e3-4fb6-9906-880820ecda92

+4
source

Now, when I install this application through setup.exe on a 64-bit machine, it is installed in the Program Files [x86] folder; I think this is a WOW function for emulating a 32-bit environment to 64-bit.

No, there is NOTHING to do with the program, only with the installer.

β€’ Installer (target platform is installed on X86 and detected dependencies installed for .net framework (x86))

The 32-bit installer installs it in a 32-bit folder for programs, not counting a 32-bit or 64-bit program.

Unfortunately, you cannot have one installer that does the same thing - you will need an installer for 32 and one for a 64-bit design concept.

This is a completely design solution for the MSI part and, again, is completely unrelated to the program.

+3
source

64 bits may or may not give differences in performance. A 64-bit application can also use (path) more memory than a 32-bit application.

If you run AnyCpu exe on a 64-bit OS, it should run on a 64-bit one (see in the task manager, 32-bit processes are added along with * 32). If you install the application on x64, the library must be either x64 or AnyCpu.

If you do not have native x64 links, you can leave exe and dll as AnyCpu, but you will need to change the setting to x64.

As for the framework, on the x64 machine (which is the only place where the x64 application will work anyway), the framework always includes both 32 and 64 bits found in C: \ Windows \ Microsoft.NET \ Framework and Framework64 respectively.

+2
source

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


All Articles