2013-02-20 28 views
2

在我的开发机器上,一切正常。但是,当我尝试在服务器上,并从代码启动,OpenOffice不能连接到端口2002.如果我从cmd启动完全相同的命令,其工作....从后台代码服务启动OpenOffice不起作用

我做错了什么?

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); 
+0

确保您要么委派用户权限,要么运行iis的帐户有权运行它。 – 2013-02-20 03:36:39

+0

服务正在任务管理器中运行。 – 2013-02-20 03:37:49

+0

如果您使用Windows身份验证,委派只是一个选项,因此可能不适用 – 2013-02-20 03:38:17

回答

0

在IIS管理器(IIS 7.5在这里),进入高级设置为您的应用程序使用的应用程序池。将“加载用户配置文件”设置为True。

这似乎是必需的,因为-nofirststartwizard,你已经有了。

这两件事结合起来对我有用。

相关问题