[Bug 148857] Handle is not initialized exception when bootstrapping with .Net (but not in .Net Framework)

2024-09-25 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=148857

Mike Kaganski  changed:

   What|Removed |Added

 Resolution|INVALID |FIXED

--- Comment #16 from Mike Kaganski  ---
Marking it FIXED, because it definitely not "INVALID", and moreover, the GSOC
change basically specifically targeted the problem here.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 148857] Handle is not initialized exception when bootstrapping with .Net (but not in .Net Framework)

2024-09-24 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=148857

--- Comment #15 from Ritobroto Mukherjee  ---
(In reply to Michele Locati from comment #13)
> But there's no nuget package with that ID at the moment:
> https://www.nuget.org/packages?q=LibreOffice.Bindings

Yes, that package is not actually hosted on nuget.org, since it's not
standalone, and instead needs a compatible build of LibreOffice to work, i.e.
one that also contains some recently added native libraries.

For some reason, the dev builds of the SDK don't seem to contain the nupkg
file. As Mr. Kaganski mentioned, there should be a file named
/dotnet/LibreOffice.Bindings.0.1.0.nupkg. But even so, just getting the
nuget package won't work, since those aforementioned native libraries need to
be present in the LO install. 

Until the next LO release, unfortunately, the path of least resistance would be
to build LO locally with the --with-dotnet option, enabling the SDK with the
setsdkenv_windows/linux scripts, and adding
[path/to/sdk]/dotnet
and  to your
.csproj file.

The docs on using the bindings are lacking right now, but I'll try to work on
them as soon as I can. Apart from this a standalong version of the bindings is
also in the works, but it might be some time before it's functional.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 148857] Handle is not initialized exception when bootstrapping with .Net (but not in .Net Framework)

2024-09-24 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=148857

--- Comment #14 from Mike Kaganski  ---
(In reply to Michele Locati from comment #13)
> But there's no nuget package with that ID at the moment:
> https://www.nuget.org/packages?q=LibreOffice.Bindings

I mentioned the *exact* directory where that package is located. Note that it's
a wrong idea that everything "nupkg" is about www.nuget.org: as MS explains
[1],

> a NuGet package is a shareable unit of code, but does not require nor imply 
> any particular means of sharing.

[1] https://learn.microsoft.com/en-us/nuget/what-is-nuget

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 148857] Handle is not initialized exception when bootstrapping with .Net (but not in .Net Framework)

2024-09-24 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=148857

--- Comment #13 from Michele Locati  ---
(In reply to Mike Kaganski from comment #12)
> (In reply to Michele Locati from comment #11)
> 
> The sample's Makefile points to a nupkg in sdk/dotnet?


The samples use this:



where LO_NUPKG_ID is LibreOffice.Bindings

But there's no nuget package with that ID at the moment:
https://www.nuget.org/packages?q=LibreOffice.Bindings

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 148857] Handle is not initialized exception when bootstrapping with .Net (but not in .Net Framework)

2024-09-24 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=148857

--- Comment #12 from Mike Kaganski  ---
(In reply to Michele Locati from comment #11)

The sample's Makefile points to a nupkg in sdk/dotnet?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 148857] Handle is not initialized exception when bootstrapping with .Net (but not in .Net Framework)

2024-09-24 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=148857

--- Comment #11 from Michele Locati  ---
> Please take a look at this minimal code from FirstUnoContact example:

@Hossein How can we test the code? Is there an SDK containing the DLLs that can
be added to a C# project?

I tried using the DLLs available in the cli directory installed by
LibreOfficeDev_25.2.0.0.alpha0_Win_x86-64_sdk.msi (available at
https://dev-builds.libreoffice.org/daily/master/Win-x86_64@tb77-TDF/2024-09-24_03.59.37
), but I can't find any NativeBootstrap object (just the old uno.util.Bootstrap
class in the cli_cppuhelper.dll file).

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 148857] Handle is not initialized exception when bootstrapping with .Net (but not in .Net Framework)

2024-09-21 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=148857

Hossein  changed:

   What|Removed |Added

 CC||1368928...@qq.com

--- Comment #10 from Hossein  ---
*** Bug 163072 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 148857] Handle is not initialized exception when bootstrapping with .Net (but not in .Net Framework)

2024-09-21 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=148857

Hossein  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--- Comment #9 from Hossein  ---
The new .NET binding for cross platform .NET has just landed in master, and in
order to use it, you need to compile LibreOffice from sources, or use daily
builds: (or maybe wait for the next release)

https://dev-builds.libreoffice.org/daily/master/current.html

To get started, look into SDK examples:

https://git.libreoffice.org/core/+/refs/heads/master/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact/csharp/

https://git.libreoffice.org/core/+/refs/heads/master/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent/csharp/

https://git.libreoffice.org/core/+/refs/heads/master/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape/csharp/

https://git.libreoffice.org/core/+/refs/heads/master/odk/examples/dotnet/WriterDemo

Please take a look at this minimal code from FirstUnoContact example:

using System;
using com.sun.star.lang;
using com.sun.star.uno;
try
{
XComponentContext xContext = NativeBootstrap.bootstrap();
Console.WriteLine("Connected to a running office...");
XMultiComponentFactory xMCF = xContext.getServiceManager();
Console.WriteLine("Remote service manager is {0}", xMCF is null ? "not
available" : "available");
return 0;
}
catch (UnoException e)
{
Console.Error.WriteLine(e.Message);
return 1;
}

It uses NativeBootstrap.bootstrap().

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 148857] Handle is not initialized exception when bootstrapping with .Net (but not in .Net Framework)

2024-09-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=148857

--- Comment #8 from liujian <1368928...@qq.com> ---
I the net8 error System. InvalidOperationException: "Handle is not
initialized."
This is normal in the netframework

Faulty code
m_xContext = uno.util.Bootstrap.bootstrap();

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 148857] Handle is not initialized exception when bootstrapping with .Net (but not in .Net Framework)

2024-01-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=148857

--- Comment #7 from eins99  ---
Since .NET Framework and .NET Core are now merged to .NET and will not see new
development anymore, it would make sense to take in consideration to go this
way also with LO. Otherwise coming releases of LO will not work with .NET.

How to deal with backward compatibility is another question.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 148857] Handle is not initialized exception when bootstrapping with .Net (but not in .Net Framework)

2024-01-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=148857

--- Comment #6 from Mike Kaganski  ---
FTR: running the DotNet6 config from the solution from comment 0, putting a
breakpoint to loadEnv (cppu/source/uno/lbenv.cxx), when it gets called for
"cli_uno", in the call to (*fpInit)( pEnv ), it will load the cli_uno.dll,
which will load C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll (seen
in VS debugger's Output window); shortly after, an exception is thrown (no idea
if it's important); and then, some assemblies for 4.0 will load, then unload;
and finally, cli_uno.dll will unload. Neither before, nor after, it will be
impossible to put a breakpoint to uno_initEnvironment in
cli_ure/source/uno_bridge/cli_bridge.cxx.

When debugging DotNetFramework4.8 config, the uno_initEnvironment in
cli_bridge.cxx will even be called directly, not from loadEnv.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 148857] Handle is not initialized exception when bootstrapping with .Net (but not in .Net Framework)

2024-01-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=148857

Mike Kaganski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 148857] Handle is not initialized exception when bootstrapping with .Net (but not in .Net Framework)

2024-01-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=148857

--- Comment #5 from Mike Kaganski  ---
https://learn.microsoft.com/en-us/dotnet/core/porting/cpp-cli

It seems to me, that the preferrable way to move forward would be to
re-implement the cli assemblies in LibreOffice in C# or other language that
doesn't have these limitations (if it is possible). Or to have a separate set
of assemblies for .NET, as we have for .NET Framework.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 148857] Handle is not initialized exception when bootstrapping with .Net (but not in .Net Framework)

2024-01-12 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=148857

--- Comment #4 from li...@ejr-online.de ---
I confirm this bug for

Version: 7.6.4.1 (X86_64) / LibreOffice Community
Build ID: e19e193f88cd6c0525a17fb7a176ed8e6a3e2aa1
CPU threads: 2; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: threaded

Since the bug is not yet assigned to anybody since one and a half year it seems
that the issue is not with high priority.

My question is if there is a workaround?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 148857] Handle is not initialized exception when bootstrapping with .Net (but not in .Net Framework)

2024-01-11 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=148857

Hossein  changed:

   What|Removed |Added

 Blocks||159125


Referenced Bugs:

https://bugs.documentfoundation.org/show_bug.cgi?id=159125
[Bug 159125] [META] .NET support
-- 
You are receiving this mail because:
You are the assignee for the bug.

[Libreoffice-bugs] [Bug 148857] Handle is not initialized exception when bootstrapping with .Net (but not in .Net Framework)

2023-10-02 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=148857

--- Comment #3 from truer0man  ---
Bug is still exist in 7.6.2.1 version of SDK. I'm using .NET 7.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Libreoffice-bugs] [Bug 148857] Handle is not initialized exception when bootstrapping with .Net (but not in .Net Framework)

2023-05-30 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=148857

Mike Kaganski  changed:

   What|Removed |Added

 CC||sberg...@redhat.com

--- Comment #2 from Mike Kaganski  ---
I repro the problem both with net6, and netcoreapp3.1, using x64 platform. Also
the same is I use 'uno.util.Bootstrap.bootstrap()' instead of
'uno.util.Bootstrap.defaultBootstrap_InitialComponentContext()'.

If you enable the mixed-mode debugging (allowing to debug native code), and put
breakpoint to mediate_mapInterface (cppu/source/uno/lbmap.cxx), then the
problem happens in the call to

(*pUno2To->mapInterface)( pUno2To, ppOut, pUnoI, pInterfaceTypeDescr );

where VS reports that mapInterface points to {cli_uno.dll!Mapping_uno2cli}, but
you can't step into it from the code editor, and when you use disassembly to
step into, it looks like a no-op, instead of the expected Mapping_uno2cli from
cli_ure/source/uno_bridge/cli_bridge.cxx. Trying to put breakpoints in the
latter function (or anywhere in the file) is impossible (the debugger tells
that "No executable code of the debugger's target code type is associated with
this line ...").

Since the actually called code is a no-op, the ppOut will still contain a
nullptr upon returning to mediate_mapInterface, and then the "Handle is not
initialized" happens.

And here I get stuck, having no experience with all this machinery. Stephan, do
you have an idea?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Libreoffice-bugs] [Bug 148857] Handle is not initialized exception when bootstrapping with .Net (but not in .Net Framework)

2022-11-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=148857

QA Administrators  changed:

   What|Removed |Added

 Whiteboard| QA:needsComment|

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Libreoffice-bugs] [Bug 148857] Handle is not initialized exception when bootstrapping with .Net (but not in .Net Framework)

2022-11-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=148857

--- Comment #1 from Vitaly  ---
Does anyone fixing this error or can say something about it?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Libreoffice-bugs] [Bug 148857] Handle is not initialized exception when bootstrapping with .Net (but not in .Net Framework)

2022-05-27 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=148857

QA Administrators  changed:

   What|Removed |Added

 Whiteboard|| QA:needsComment

-- 
You are receiving this mail because:
You are the assignee for the bug.