安装版本抛出异常 "the system cannot find the file specified" exe 运行正常

Installed version throw exception "the system cannot find the file specified" exe runs fine

我创建了一个带有帮助菜单的应用程序。

帮助的回调函数应该打开一个Word文件。

我已将文件 User's Manual v2.docx 附加到项目(将其设置为嵌入式资源),当我从 VS 运行 它和我从 运行 它时它工作自己执行。但是当我安装应用程序和 运行 安装的 exe 时,帮助回调函数抛出异常:

the system cannot find the file specified

private void manualToolStripMenuItem_Click(object sender, EventArgs e)
{
     Process.Start("User's Manual v2.docx");
}

谁知道出了什么问题and/or如何让它工作?

它没有使用资源文件,它正在寻找您嵌入的文件。将其作为资源取出并将文件添加到您的项目中。确保始终设置复制,或者如果较新则复制到 word 文件。

如果你想嵌入它,那么你不必将它作为一个额外的文件。您需要从资源中提取它,将其保存为(临时?)文件,然后为此调用 Process.Start。