簡體   English   中英

System.ComponentModel.Win32Exception:找不到路徑

[英]System.ComponentModel.Win32Exception: Path not found

在我的 WPF 應用程序中,我可以使用以下命令:

Process.Start(@"C:\Windows\System32\appwiz.cpl");

但這不起作用:

Process.Start(@"C:\Windows\System32\firewall.cpl");

我得到(德語):System.ComponentModel.Win32Exception:“Das System kann die angegebene Datei nicht finden”。 文件未找到。 但是當我將C:\Windows\System32\firewall.cpl放到我的文件資源管理器中時,Firewall.cpl 正在打開。 我嘗試了其他一些:

好的:

  • 辦公桌.cpl
  • hdwwiz.cpl
  • inetcpl.cpl
  • 國際化cpl
  • 歡樂.cpl
  • 主文件
  • mmsys.cpl

挪威克朗:

  • 防火牆.cpl
  • igfxCPL.cpl
  • compmgmtlauncher.exe

問題是什么?

根據評論,解決方案是c:\windows\sysnative\firewall.cplProject > Properties > Build tab"Prefer 32-bit"未勾選。

https://docs.microsoft.com/en-us/windows/win32/winprog64/file-system-redirector

您也可以參考此鏈接下的兩個答案。

我如何將我的 Windows 窗體與 .NET 框架鏈接到 Steam 而不會出現構建錯誤

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM