System.ComponentModel.Win32Exception: 系统找不到指定的文件

问题描述:

System.ComponentModel.Win32Exception: 系统找不到指定的文件。
   在 System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
   在 System.Diagnostics.Process.Start()
   在 SmallScene.Login.Login_Load(Object sender, EventArgs e)

   在 System.Windows.Forms.Form.OnLoad(EventArgs e)
   在 System.Windows.Forms.Form.OnCreateControl()
   在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   在 System.Windows.Forms.Control.CreateControl()
   在 System.Windows.Forms.Control.WmShowWindow(Message& m)
   在 System.Windows.Forms.Control.WndProc(Message& m)
   在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   在 System.Windows.Forms.ContainerControl.WndProc(Message& m)
   在 System.Windows.Forms.Form.WmShowWindow(Message& m)
   在 System.Windows.Forms.Form.WndProc(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** 已加载的程序集 **************
mscorlib
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3620 (GDR.050727-3600)
    基本代码: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
System
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3614 (GDR.050727-3600)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
SmallSceneBLL
    程序集版本: 1.0.0.0
    Win32 版本: 1.0.0.0
    基本代码: file:///C:/Program%20Files/导航定位系统/SmallSceneBLL.DLL
----------------------------------------
System.Configuration
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Data.OracleClient
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
    基本代码: file:///C:/WINDOWS/assembly/GAC_32/System.Data.OracleClient/2.0.0.0__b77a5c561934e089/System.Data.OracleClient.dll
----------------------------------------
System.Data
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
    基本代码: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Xml
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Data.OracleClient.resources
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Data.OracleClient.resources/2.0.0.0_zh-CHS_b77a5c561934e089/System.Data.OracleClient.resources.dll
----------------------------------------
System.Transactions
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
    基本代码: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
    基本代码: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
mscorlib.resources
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3620 (GDR.050727-3600)
    基本代码: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
System.Windows.Forms.resources
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_zh-CHS_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------

************** JIT 调试 **************
要启用实时(JIT)调试,
该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置
jitDebugging 值。
编译应用程序时还必须启用
调试。

例如:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

启用 JIT 调试后,任何无法处理的异常
都将被发送到在此计算机上注册的 JIT 调试器,
而不是由此对话框处理。

解决方法:

这个错误是在打包一个vs程序,安装完成启动该程序时弹出的错误。该程序在启动时调用了其它的.exe程序,双击安装后的快捷方式会报此错误。如果直接在安装目录下启动该程序则不会报错。

这个错误是在调用.exe时,process的错误,程序中开始是这样调用的.exe:

System.Diagnostics.Process.Start("qq.exe");将.exe所在的路径写成程序的绝对路径就不会出此错误了,如下

System.Diagnostics.Process.Start(Application.StartupPath + "\\qq.exe");

posted @ 2011-05-10 16:53  柠檬绿松  阅读(54939)  评论(0编辑  收藏  举报
View Code