请原谅我这里没有任何正确的格式,但我迫切需要一个解决这个问题的方法,直到此时我才知道它的存在。
在运行 Process.Start() 时;我遇到了这个问题:
Unhandled Exception: System.ComponentModel.Win32Exception: The operation was canceled by the user
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(String fileName)
at WorkDamnit.Program.Main(String[] args)
无论我为什么尝试,我似乎永远无法解决这个问题。它似乎不是基于我的代码(见下文),因为我专门做了一个全新的项目来找出问题(当然没有运气)。
总之,罪魁祸首来了。我认为有更多经验的人会更幸运地尝试解决这个问题。也许我在我的 Visual Studio 安装中遗漏了一些东西。
Process process1 = Process.Start("Render\\PHOENIXRender.exe");
Console.ReadKey();
最佳答案
Eureka !感谢所有发表评论的人。事实证明,问题与 OneDrive 同步和一般 OneDrive 有关。
我不确定为什么会出现这个问题,但我很高兴我可以继续我的工作。
关于C# - Process.Start() 操作被用户取消,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59654697/