I get 'A 32 bit processes cannot access modules of a 64 bit process.' exception invoking Process.Start()

前端 未结 2 1029
清歌不尽
清歌不尽 2021-01-11 20:32

Here is the code sample

var startInfo = new ProcessStartInfo
{
    Arguments = commandStr,
    FileName = @"C:\\Windows\\SysWOW64\\logman.exe",
};

         


        
2条回答
  •  不知归路
    2021-01-11 21:35

    Choosing Any CPU for Platform target is not enough, you also have to uncheck Prefer 32-bit, otherwise the application will still be run as a 32-bit application.

    This is only possible on application projects, not on library project. If your project is a library, you must do it in the project using your library.

提交回复
热议问题