"Cannot find runtime version to run this application" for a 32-bit application on 64-bit Windows

I am developing a 32-bit WinForm application (target: .NET 3.5). My client insists that the application be installed in the folder "Windows \ System32 \ clientname" and autorun at startup. In addition, the application must be 32-bit, so I can not use "Any processor."

I am developing for Win7 x64 with VS2010, and all versions of .NET are installed. When I launch the application, I get the message "Unable to find the version of runtime to run this application." On Win7 x86 it works without problems. This is not an application, and I am 100% sure that all the necessary frameworks are installed.

I know that in the x64 system this folder will not be used for 32-bit applications, but, as I said, the client insists and does not budge.

Before I finally tell the client that this is not possible, I want to explore all the options. Of course, I googled, and also searched this beautiful site, but there was nothing useful for my specific situation.

My application starts another 32-bit process located in the same folder. Of course, on x64, which didn't work either, but I solved it using "Wow64DisableWow64FsRedirection" and then copying it to another place to run it from there (which works fine). I did my homework, but I just can’t find a solution to run the main application under x64 and in this particular folder.

Is there one?

+4
source share
1 answer

In an attempt to solve this problem, I created two folders on my Win7 x64 machine:

  • C:\Windows\System32\ClientName ; and
  • C:\Windows\SysWOW64\ClientName

Next, I created a simple x86 WinForms application focused on .NET 3.5. I found that if I copied the executable to C:\Windows\System32\ClientName , I received exactly the same error message as you reported.

However, if I copied the executable to both directories, I could start it with C:\Windows\System32\ClientName , and it worked fine.

I have not tried this, but I suspect that if you have an application with several assemblies, you only need to copy the *.exe to C:\Windows\System32\ClientName . All other files (and EXE) will then be located in the C:\Windows\SysWOW64\ClientName .

This is a slightly untidy decision, I know, but then again, your customer requirements are a bit unusual for a start.

+3
source

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


All Articles