I have the following code that will not work on the x64 operating system, since notepad.exe is x64, and the x86 application cannot get information about the modules of the x64 process.
prc.Modules[0].FileName
.Net exception throws my code
System.ComponentModel.Win32Exception (0x80004005): 32-bit processes cannot ess modules of a 64-bit process.
According to many answers and articles on this forum, MSDN, ..., I know that I need to use AnyCPU instead because using x64 has no specific benefit for me. (INCORRECT: I checked the code with the performance check, and the x64 code worked 40 ms faster. Don’t pay attention, I don’t want my code to work 40 ms faster: D) instead, I will not have such problems. but even when compiling in AnyCPU configuration. my error persists, moreover, in the Task Manager I see (32-bit) at the end of my process name.
I do not know what is wrong. VS 2011 Beta (x64) Preview of Windows 8 (x64)
Sincerely yours, Peyman Mortazavi
source
share