这是代码示例
var startInfo = new ProcessStartInfo
{
Arguments = commandStr,
FileName = @"C:\Windows\SysWOW64\logman.exe",
};
using (var createCounterProc = new Process { StartInfo = startInfo })
{
createCounterProc.Start();
createCounterProc.WaitForExit();
}
Run Code Online (Sandbox Code Playgroud)
运行代码后,我得到"32位进程无法访问64位进程的模块".MainModule中的消息(NativeErrorCode:299).我的解决方案配置为AnyCPU.我已经尝试了64位和32位版本的logman.exe(C:\ Windows\SysWOW64\logman.exe和C:\ Windows\System32\logman.exe)但我仍然有同样的错误.我的操作系统是Win8.1Prox64.什么可能导致问题?
堆栈跟踪:
Run Code Online (Sandbox Code Playgroud)at System.Diagnostics.NtProcessManager.GetModuleInfos(Int32 processId, Boolean firstModuleOnly) at System.Diagnostics.NtProcessManager.GetFirstModuleInfo(Int32 processId) at System.Diagnostics.Process.get_MainModule()
以下是Build配置: 在此处输入图像描述