在我的开发机器上一切正常。但是当我在服务器上尝试并从代码启动它时,OpenOffice 无法连接到端口 2002。如果我使用完全相同的命令从 cmd 启动它,它的工作....
我做错了什么?
命令命令
c:/openoffice/program/soffice.exe -headless -nologo -nofirststartwizard -norestore -accept=socket,host=localhost,port=2002;urp;StarOffice.Service
来自代码
var info = new ProcessStartInfo("c:/openoffice/program/soffice.exe")
{
UseShellExecute = false,
RedirectStandardInput = true,
RedirectStandardOutput = true,
RedirectStandardError = true,
Arguments = "-headless -nologo -nofirststartwizard -norestore -accept=socket,host=localhost,port=2002;urp;StarOffice.Service"
};
var result = Process.Start(info);
最佳答案
在 IIS 管理器(此处为 IIS 7.5)中,进入您的应用程序使用的应用程序池的高级设置。将“加载用户配置文件”设置为 True。
这似乎是必需的,您已经拥有的 -nofirststartwizard
也是如此。
这两件事结合起来对我有用。
关于c# - 从后台代码启动 OpenOffice 作为服务不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14971797/