System.ComponentModel.Win32Exception:拒绝访问

时间:2011-01-05 07:29:32

标签: c# winforms desktop-application access-denied

我正在开发基于C#windows的应用程序。我正在

  

System.ComponentModel.Win32Exception:   访问被拒绝

在我安装的应用程序中。

2011-01-05 12:41:42,916, ERROR, RINXUI.main, System.ComponentModel.Win32Exception: Access is denied
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()

只有在安装应用程序时才会出现此错误。当我尝试从Visual Studio调试我的应用程序时,没有例外。

我已经使用IzPack安装程序实用程序安装了应用程序,并将其安装在桌面上(用于测试目的)。

任何人都知道为什么只在已安装的版本中发生此异常?

2 个答案:

答案 0 :(得分:2)

堆栈跟踪中的System.Diagnostics.Process.Start()怎么样?您是否尝试从应用程序启动任何进程。如果是,则需要查看运行应用程序的a / c是否具有足够的权限来读取/写入存储可执行文件的位置。

答案 1 :(得分:-2)

我还遇到了这个错误消息,它通过mono some-executable从osx运行一些代码。需要chmod u+x执行可执行文件。