way to force 32bit execution of .NET 2.0 in a x64 environment? : DOTNET
This is a discussion on way to force 32bit execution of .NET 2.0 in a x64 environment? within the DOTNET forums in Framework and Interface Programming category; Hello. I'm hoping for a solution to my problem, but at the same time I suspect that I may have to go back to the development team. I am trying to run a windows application written for a 32 bit environment on my Windows 2003 R2 SP2 x64 server. I have done a lot of research, and I know that the new WOW is supposed to automatically determine if the application should run in 32 or 64 mode. I have the .Net 2.0 x64 package (plus SDK) installed on this machine, but the application crashes with a kernel32.dll error during ...
| DOTNET Discussion forums related to Microsoft Dot net technologies, CSharp and other related items |
![]() |
| | LinkBack | Thread Tools |
|
#1
| |||
| |||
| suspect that I may have to go back to the development team. I am trying to run a windows application written for a 32 bit environment on my Windows 2003 R2 SP2 x64 server. I have done a lot of research, and I know that the new WOW is supposed to automatically determine if the application should run in 32 or 64 mode. I have the .Net 2.0 x64 package (plus SDK) installed on this machine, but the application crashes with a kernel32.dll error during loading. When I ran filemon it seems that it's loading the x64 .NET framework, not the 32bit version. I've found a lot of information regarding forcing the application from a code perspective, but it doesn't help me since it's not owned by my company. I've also tried running it in xp and 2000 mode (application compat). The vendor is not willing to support x64 environments at this time. Any suggestions are greatly appreciated. Thank you for your time. Ben |
|
#2
| |||
| |||
| When they build the application, they should set the target platform to "x86" rather than "any cpu". I believe if they do this, your server will rtun it as a 32-bit application. RobinS. GoldMail, Inc. ---------------------------- "Benjamin Leak" <BenjaminLeak@discussions.microsoft.com> wrote in message news:582E7F60-DF38-4DEF-8B22-2487E456495E@microsoft.com... > Hello. I'm hoping for a solution to my problem, but at the same time I > suspect that I may have to go back to the development team. I am trying > to > run a windows application written for a 32 bit environment on my Windows > 2003 > R2 SP2 x64 server. I have done a lot of research, and I know that the > new > WOW is supposed to automatically determine if the application should run > in > 32 or 64 mode. > > I have the .Net 2.0 x64 package (plus SDK) installed on this machine, but > the application crashes with a kernel32.dll error during loading. When I > ran filemon it seems that it's loading the x64 .NET framework, not the > 32bit > version. > > I've found a lot of information regarding forcing the application from a > code perspective, but it doesn't help me since it's not owned by my > company. > I've also tried running it in xp and 2000 mode (application compat). The > vendor is not willing to support x64 environments at this time. > > Any suggestions are greatly appreciated. Thank you for your time. > > Ben |
|
#3
| |||
| |||
| Benjamin Leak wrote: > Hello. I'm hoping for a solution to my problem, but at the same time I > suspect that I may have to go back to the development team. I am trying to > run a windows application written for a 32 bit environment on my Windows 2003 > R2 SP2 x64 server. I have done a lot of research, and I know that the new > WOW is supposed to automatically determine if the application should run in > 32 or 64 mode. > > I have the .Net 2.0 x64 package (plus SDK) installed on this machine, but > the application crashes with a kernel32.dll error during loading. When I > ran filemon it seems that it's loading the x64 .NET framework, not the 32bit > version. > > I've found a lot of information regarding forcing the application from a > code perspective, but it doesn't help me since it's not owned by my company. > I've also tried running it in xp and 2000 mode (application compat). The > vendor is not willing to support x64 environments at this time. > > Any suggestions are greatly appreciated. Thank you for your time. > > Ben I had researched about this issue. If you cannot ask the owned company to recompile the app just as RobinS said, you can try my method. However, I just tested in very simple application. I assume you can make a simple dotnet app. You need to make a very simple pure 32 bit dotnet app firstly. In the 32bit app "Main" function, using the code ///////////////////////////////////////////////////// /* this context is in 32bit process space */ string path = System.IO.Path.GetDirectoryName(Application.ExecutablePath) + "\\App64.exe"; //path finally points to the target app full path Assembly assm64 = Assembly.LoadFile(path); Type t=assm64.GetType("App64.Program"); /* "App64.Program" is the class which contains the static Main() entry point function */ MethodInfo mf = t.GetMethod("Main", BindingFlags.Static | BindingFlags.NonPublic ); mf.Invoke(null, null); //////////////////////////////////////////////////////// "App64.exe" is actually a Dotnet2 app compiled with "Any CPU" The pure 32bit launcher app should be placed in the same folder with the target "Any CPU" app. -- Jacky Kwok jacky@alumni_DOT_cuhk_DOT_edu_DOT_hk |
|
#4
| |||
| |||
| RobinS, Thanks! It looks like I'm going to need to put in a feature request to the vendor, and knowing exactly what to ask should really help me in the long run. In the mean time, I am going to try Jacky's solution. Again, I really appreciate the reponse! Ben "RobinS" wrote: > When they build the application, they should set the target platform to > "x86" rather than "any cpu". I believe if they do this, your server will > rtun it as a 32-bit application. > > RobinS. > GoldMail, Inc. > ---------------------------- > "Benjamin Leak" <BenjaminLeak@discussions.microsoft.com> wrote in message > news:582E7F60-DF38-4DEF-8B22-2487E456495E@microsoft.com... > > Hello. I'm hoping for a solution to my problem, but at the same time I > > suspect that I may have to go back to the development team. I am trying > > to > > run a windows application written for a 32 bit environment on my Windows > > 2003 > > R2 SP2 x64 server. I have done a lot of research, and I know that the > > new > > WOW is supposed to automatically determine if the application should run > > in > > 32 or 64 mode. > > > > I have the .Net 2.0 x64 package (plus SDK) installed on this machine, but > > the application crashes with a kernel32.dll error during loading. When I > > ran filemon it seems that it's loading the x64 .NET framework, not the > > 32bit > > version. > > > > I've found a lot of information regarding forcing the application from a > > code perspective, but it doesn't help me since it's not owned by my > > company. > > I've also tried running it in xp and 2000 mode (application compat). The > > vendor is not willing to support x64 environments at this time. > > > > Any suggestions are greatly appreciated. Thank you for your time. > > > > Ben > > |
|
#5
| |||
| |||
| Benjamin Leak wrote: > Hello. I'm hoping for a solution to my problem, but at the same time I > suspect that I may have to go back to the development team. I am trying to > run a windows application written for a 32 bit environment on my Windows 2003 > R2 SP2 x64 server. I have done a lot of research, and I know that the new > WOW is supposed to automatically determine if the application should run in > 32 or 64 mode. > > I have the .Net 2.0 x64 package (plus SDK) installed on this machine, but > the application crashes with a kernel32.dll error during loading. When I > ran filemon it seems that it's loading the x64 .NET framework, not the 32bit > version. > > I've found a lot of information regarding forcing the application from a > code perspective, but it doesn't help me since it's not owned by my company. > I've also tried running it in xp and 2000 mode (application compat). The > vendor is not willing to support x64 environments at this time. > You can force 32-bit execution without recompilation by using the "corflags" utility included in the .NET SDK. -- J. |

