![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I have the following problem: I have a .net 2.0 application, which dynamically loads a Managed C++ assembly. The managed c++ assembly has the ProcessorArchitecture correctly set to x86 (32 Bit). The application however does not have the 32Bit-Corflag set and is therefore loaded by the x64 version of the .net framework runtime (64 Bit). So when the application tries to load the Managed C++ assembly I get an exception, because it cannot use the 32 Bit managed C++ assembly in the 64 Bit application. So I need a way to force the os to load an assembly with the 32 Bit runtime and not the 64 Bit runtime. I know that I can use the "corflags" application in the SDK to set the 32Bit-Flag, but since the application is a strong signed 3rd party application it does not allow me to do this (and since I don't have the source code I cannot recompile it either). |
#3
| |||
| |||
|
|
"Thomas Krause" <Forum.Thomas.Krause-NoSpam- (AT) gmx (DOT) de> wrote: Hello, I have the following problem: I have a .net 2.0 application, which dynamically loads a Managed C++ assembly. The managed c++ assembly has the ProcessorArchitecture correctly set to x86 (32 Bit). The application however does not have the 32Bit-Corflag set and is therefore loaded by the x64 version of the .net framework runtime (64 Bit). So when the application tries to load the Managed C++ assembly I get an exception, because it cannot use the 32 Bit managed C++ assembly in the 64 Bit application. So I need a way to force the os to load an assembly with the 32 Bit runtime and not the 64 Bit runtime. I know that I can use the "corflags" application in the SDK to set the 32Bit-Flag, but since the application is a strong signed 3rd party application it does not allow me to do this (and since I don't have the source code I cannot recompile it either). The only way I know to do this is to build your own launcher application, load the 3rd party application assembly and run its main method. EG Compile the following with x86 target: using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using System.Reflection; namespace Run32bit { class Program { static void Main(string[] args) { try { string target = @"c:\program files\Whatever\whatever.exe"; Assembly target = Assembly.LoadFile(target); target.EntryPoint.Invoke(null, new object[] { args }); } catch (Exception ex) { Console.WriteLine(ex); } } } } David |
#4
| |||
| |||
|
|
Hello, I have the following problem: I have a .net 2.0 application, which dynamically loads a Managed C++ assembly. The managed c++ assembly has the ProcessorArchitecture correctly set to x86 (32 Bit). The application however does not have the 32Bit-Corflag set and is therefore loaded by the x64 version of the .net framework runtime (64 Bit). So when the application tries to load the Managed C++ assembly I get an exception, because it cannot use the 32 Bit managed C++ assembly in the 64 Bit application. So I need a way to force the os to load an assembly with the 32 Bit runtime and not the 64 Bit runtime. I know that I can use the "corflags" application in the SDK to set the 32Bit-Flag, but since the application is a strong signed 3rd party application it does not allow me to do this (and since I don't have the source code I cannot recompile it either). Thanks, Thomas Krause |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |