前面发了个帖了解怎样合并项目,发现好多人推荐使用"process.start()"方法,然后我就使用了,现在出了点小问题,苦思不得其解:
首先,我将3个项目分别放在3个文件夹中,分别为1,2,3,将他们放到主窗口项目的debug文件夹下面,让后通过3个按钮指向他们(process.start("1\\sa**.exe")),运行的时候出问题了。
第2个按钮点击之后一切正常,另外两个有问题。
第1个按钮点击后弹出了窗口,当我关闭它的时候就会弹出错误:应用程序出现无法处理异常,加载配置文件出错:参数"exePath”无效。参数名:exePath;
详细信息如下:
有关调用实时(JIT)调试而不是此对话框的详细信息,
请参见此消息的结尾。************** 异常文本 **************
System.Configuration.ConfigurationErrorsException: 加载配置文件时出错: 参数“exePath”无效。
参数名: exePath ---> System.ArgumentException: 参数“exePath”无效。
参数名: exePath
   在 System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig)
   在 System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)
   在 System.Configuration.ClientConfigurationHost.get_ConfigPaths()
   在 System.Configuration.ClientConfigurationHost.GetStreamName(String configPath)
   在 System.Configuration.Internal.DelegatingConfigHost.GetStreamName(String configPath)
   在 System.Configuration.BaseConfigurationRecord.InitConfigFromFile()
   --- 内部异常堆栈跟踪的结尾 ---
   在 System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
   在 System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
   在 System.Configuration.Configuration..ctor(String locationSubPath, Type typeConfigHost, Object[] hostInitConfigurationParams)
   在 System.Configuration.ClientConfigurationHost.OpenExeConfiguration(ConfigurationFileMap fileMap, Boolean isMachine, ConfigurationUserLevel userLevel, String exePath)
   在 System.Configuration.ConfigurationManager.OpenExeConfigurationImpl(ConfigurationFileMap fileMap, Boolean isMachine, ConfigurationUserLevel userLevel, String exePath)
   在 System.Configuration.ConfigurationManager.OpenExeConfiguration(String exePath)
   在 海冰监测.UCtrCheck.Save() 位置 D:\文件\海冰综合\项目1:视频海冰\视频海冰源代码\海冰监测系统\UCtrCheck.cs:行号 164
   在 海冰监测.FrmMain.FrmMain_FormClosed(Object sender, FormClosedEventArgs e) 位置 D:\文件\海冰综合\项目1:视频海冰\视频海冰源代码\海冰监测系统\FrmMain.cs:行号 154
   在 System.Windows.Forms.Form.OnFormClosed(FormClosedEventArgs e)
   在 System.Windows.Forms.Form.WmClose(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.3625 (GDR.050727-3600)
    基本代码: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
海冰监测
    程序集版本: 1.0.0.0
    Win32 版本: 1.0.0.0
    基本代码: file:///D:/文件/综合海冰系统/WindowsFormsApplication1/bin/Release/3/海冰监测.exe
----------------------------------------
System.Windows.Forms
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3623 (GDR.050727-3600)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.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
----------------------------------------
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
    程序集版本: 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.3082 (QFE.050727-3000)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Windows.Forms.resources
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.42 (RTM.050727-4200)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_zh-CHS_b77a5c561934e089/System.Windows.Forms.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.3625 (GDR.050727-3600)
    基本代码: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Microsoft.DirectX.AudioVideoPlayback
    程序集版本: 1.0.2902.0
    Win32 版本: 9.15.779.0000
    基本代码: file:///D:/文件/综合海冰系统/WindowsFormsApplication1/bin/Release/3/Microsoft.DirectX.AudioVideoPlayback.DLL
----------------------------------------
Emgu.CV
    程序集版本: 1.5.0.1
    Win32 版本: 1.5.0.1
    基本代码: file:///D:/文件/综合海冰系统/WindowsFormsApplication1/bin/Release/3/Emgu.CV.DLL
----------------------------------------
system.configuration.resources
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.42 (RTM.050727-4200)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration.resources/2.0.0.0_zh-CHS_b03f5f7f11d50a3a/System.Configuration.resources.dll
----------------------------------------************** JIT 调试 **************
要启用实时(JIT)调试,
该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置
jitDebugging 值。
编译应用程序时还必须启用
调试。例如: <configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>启用 JIT 调试后,任何无法处理的异常
都将被发送到在此计算机上注册的 JIT 调试器,
而不是由此对话框处理。
然后第三个按钮会在点击时弹出这个错误信息,

解决方案 »

  1.   

    点击时就弹出这个信息   有关调用实时(JIT)调试而不是此对话框的详细信息,
    请参见此消息的结尾。************** 异常文本 **************
    System.Configuration.ConfigurationErrorsException: 加载配置文件时出错: 参数“exePath”无效。
    参数名: exePath ---> System.ArgumentException: 参数“exePath”无效。
    参数名: exePath
       在 System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig)
       在 System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)
       在 System.Configuration.ClientConfigurationHost.get_ConfigPaths()
       在 System.Configuration.ClientConfigurationHost.GetStreamName(String configPath)
       在 System.Configuration.Internal.DelegatingConfigHost.GetStreamName(String configPath)
       在 System.Configuration.BaseConfigurationRecord.InitConfigFromFile()
       --- 内部异常堆栈跟踪的结尾 ---
       在 System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
       在 System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
       在 System.Configuration.Configuration..ctor(String locationSubPath, Type typeConfigHost, Object[] hostInitConfigurationParams)
       在 System.Configuration.ClientConfigurationHost.OpenExeConfiguration(ConfigurationFileMap fileMap, Boolean isMachine, ConfigurationUserLevel userLevel, String exePath)
       在 System.Configuration.ConfigurationManager.OpenExeConfigurationImpl(ConfigurationFileMap fileMap, Boolean isMachine, ConfigurationUserLevel userLevel, String exePath)
       在 System.Configuration.ConfigurationManager.OpenExeConfiguration(String exePath)
       在 Satellite.MainForm.appConfigLoad() 位置 C:\Documents and Settings\Administrator\桌面\Ice System 3 20111212\Satellite\MainForm.cs:行号 191
       在 Satellite.MainForm.MainForm_Load(Object sender, EventArgs e) 位置 C:\Documents and Settings\Administrator\桌面\Ice System 3 20111212\Satellite\MainForm.cs:行号 130
       在 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.3625 (GDR.050727-3600)
        基本代码: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    Satellite
        程序集版本: 1.0.0.0
        Win32 版本: 1.0.0.0
        基本代码: file:///D:/文件/综合海冰系统/WindowsFormsApplication1/bin/Release/1/Satellite.exe
    ----------------------------------------
    System.Windows.Forms
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.3623 (GDR.050727-3600)
        基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
        基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.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
    ----------------------------------------
    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.Xml
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.3082 (QFE.050727-3000)
        基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    system.configuration.resources
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.42 (RTM.050727-4200)
        基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration.resources/2.0.0.0_zh-CHS_b03f5f7f11d50a3a/System.Configuration.resources.dll
    ----------------------------------------
    mscorlib.resources
        程序集版本: 2.0.0.0
        Win32 版本: 2.0.50727.3625 (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.42 (RTM.050727-4200)
        基本代码: 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 调试器,
    而不是由此对话框处理。
      

  2.   

    估计是应用程序的config配置文件出为题了,建议三个程序公用一个配置文件
      

  3.   

    我们原来做的时候是吧配置信息写到一个ini文件中的
      

  4.   

    怎么写到一个配置文件中呢?
    我在主窗口项目里面添加了个config文件,把有关配置信息写了进去,也是有问题。但是我直接在1,2,3文件夹下运行3个exe没问题的
    为什么通过主窗口启动就会出问题呢?
    确实有一个启动很多配置文件中的信息没有载入,那么它是通过什么方式读配置文件的呢?
    ini文件怎么用啊?
    谢谢
      

  5.   

    你给我邮箱,我给你发一个ini文件的操作类,很简单的