我遇到了一个奇怪的问题。每当我尝试通过另一个应用程序启动我的应用程序时,我有以下错误: 未处理的例外:
System.IO.IOException:路径“/ mnt / hdd4to / test / [Unknown]”的句柄无效 在System.IO.FileStream.ReadData(System.Runtime.InteropServices.SafeHandle safeHandle,System.Byte [] buf,System.Int32 offset,System.Int32 count)[0x0002d]
in< ee725f74938b4972b8a81df0be67ae23>:0
在System.IO.FileStream.ReadInternal(System.Byte [] dest,System.Int32 offset,System.Int32 count)[0x00026] in< ee725f74938b4972b8a81df0be67ae23>:0
在System.IO.FileStream.Read(System.Byte []数组,System.Int32 offset,System.Int32 count)[0x000a1] in< ee725f74938b4972b8a81df0be67ae23>:0
这是我用来启动第二个应用程序的代码:
Process secondApp = new Process();
secondApp.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
if (IsLinux())
{
// I tried with secondApp.exe
secondApp.StartInfo.FileName = "/usr/bin/mono";
// I tried with -update only as well
secondApp.StartInfo.Arguments = "secondApp.exe -update";
}
else
{
secondApp.StartInfo.FileName = path;
secondApp.StartInfo.Arguments = "-update";
}
Thread.Sleep(3000); // To remove
secondApp.Start();
Environment.Exit(0);
有没有人知道我做错了什么?