小编Max*_*Max的帖子

我得到'32位进程无法访问64位进程的模块.' 异常调用Process.Start()

这是代码示例

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.什么可能导致问题?

堆栈跟踪:

at System.Diagnostics.NtProcessManager.GetModuleInfos(Int32 processId, Boolean firstModuleOnly)
   at System.Diagnostics.NtProcessManager.GetFirstModuleInfo(Int32 processId)
   at System.Diagnostics.Process.get_MainModule()
Run Code Online (Sandbox Code Playgroud)

以下是Build配置: 在此处输入图像描述

c# cpu-architecture

10
推荐指数
1
解决办法
1万
查看次数

标签 统计

c# ×1

cpu-architecture ×1