Bootstrap Uno LibreOffice异常

问题描述 投票:0回答:1

使用以下代码。

static void Main()
{
    try
    {
        var context = uno.util.Bootstrap.bootstrap();
    }
    catch (Exception ex)
    {
       Console.WriteLine(ex.toString());
    }
}

这段代码在win 7中工作正常,但得到 "SEH Exception handled by user code External component has thrown an exception"。

最新版本:Libreoffice 5.0.3.2.请立即帮我解决这个问题。

exception c#-4.0 exception-handling libreoffice uno
1个回答
0
投票

看另一个主题的响应。

Bootstrap Uno API LibreOffice异常


var unoPath = @"C:\Program Files\LibreOffice 5\program"
// when running 32-bit LibreOffice on a 64-bit system, the path will be in Program Files (x86)
// var unoPath = @"C:\Program Files (x86)\LibreOffice 5\program"

SetEnvironmentVariable("UNO_PATH", unoPath, EnvironmentVariableTarget.Process);
SetEnvironmentVariable("PATH", GetEnvironmentVariable("PATH") + @";" + unoPath, EnvironmentVariableTarget.Process);````

© www.soinside.com 2019 - 2024. All rights reserved.