Bug 94460 - External component has thrown an exception, Bootstrap.Bootstrap(), .NET 4 UNO CLI, LibreOffice 5
Summary: External component has thrown an exception, Bootstrap.Bootstrap(), .NET 4 UNO...
Status: RESOLVED DUPLICATE of bug 94265
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
5.0.4.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium critical
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-23 10:26 UTC by Tahir Nazir
Modified: 2016-01-13 14:54 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tahir Nazir 2015-09-23 10:26:56 UTC
With the following code:

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

I can start Writer of LibreOffice. This works fine with Version 4.4.4 but after installing version 5 and with new SDK, Bootstrap.bootstrap() throws the exception:

"External component has thrown an exception"

Has anyone faced the same problem or some solution? (.NET 4.0, Windows 7 64-bit, LibreOffice 5.0 Lite)

Stack Trace 
System.Runtime.InteropServices.SEHException (0x80004005): Eine externe Komponente hat eine Ausnahme ausgelöst.
   bei cppu.bootstrap(Reference<com::sun::star::uno::XComponentContext>* )
   bei uno.util.Bootstrap.bootstrap()
Comment 1 Tahir Nazir 2015-09-23 10:28:03 UTC
I have tried to set UNO_PATH to LibreOffice 5 folder but still it won't work.
Comment 2 marten 2015-11-02 16:12:50 UTC
Can confirm this bug also -- these problems with .NET are really a product add-on stopper. 

Even with 5.0.2.2 it is not working - this happens with all new versions (4.x in the beginning had also these problems).
Comment 3 marten 2015-11-02 16:15:09 UTC
(In reply to marten from comment #2)
> Can confirm this bug also -- these problems with .NET are really a product
> add-on stopper. 
> 
> Even with 5.0.2.2 it is not working - this happens with all new versions
> (4.x in the beginning had also these problems).

Here I have Windows 8.1 (64 Bit) with .NET 4.x ... the latest version working here is 4.4.5
Comment 4 Maxim Monastirsky 2015-11-04 14:35:42 UTC
'Version' field should indicate the earliest affected release.
Comment 5 Stefano Fraccaro 2016-01-09 10:33:14 UTC
Seems a duplicate bug of 
https://bugs.documentfoundation.org//show_bug.cgi?id=94265

Right?
Comment 6 APS 2016-01-13 14:54:05 UTC
I can confirm that the bug is present on version Fresh 5.0.4.2 Fresh and that this is a duplicate of https://bugs.documentfoundation.org//show_bug.cgi?id=94265

I've found a workaround adding C:\Program Files (x86)\LibreOffice 5\program to PATH environment variable or by setting it via code in this way

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


Ref: http://stackoverflow.com/questions/31856025/bootstrap-uno-api-libreoffice-exception

P.S.: UNO_PATH variable seems useless.

*** This bug has been marked as a duplicate of bug 94265 ***