【问题标题】:Starting OpenOffice as service from code behind doesn't work从后面的代码启动 OpenOffice 作为服务不起作用
【发布时间】:2013-02-20 03:31:14
【问题描述】:

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

我做错了什么?

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 的帐户有权运行它。
  • 服务正在任务管理器中运行..
  • 只有在您使用 Windows 身份验证时才能选择委托,因此可能不适用
  • 我误读了您的问题,请忽略那些以前的 cmets。尽管它似乎仍然可能与权限相关,但与执行权限无关。

标签: c# asp.net asp.net-mvc openoffice.org


【解决方案1】:

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

这似乎是必需的,就像您已经拥有的 -nofirststartwizard 一样。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-07-23
    • 1970-01-01
    • 1970-01-01
    • 2012-03-15
    • 1970-01-01
    • 1970-01-01
    • 2013-11-20
    • 2015-09-06
    相关资源
    最近更新 更多