Bug 165608 - LibreOffice .NET SDK examples / tests are bound to a specific version
Summary: LibreOffice .NET SDK examples / tests are bound to a specific version
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
24.8.0.3 release
Hardware: All All
: medium normal
Assignee: Hossein
URL:
Whiteboard: target:26.2.0
Keywords:
Depends on:
Blocks: .NET
  Show dependency treegraph
 
Reported: 2025-03-06 13:34 UTC by Hossein
Modified: 2025-09-16 22:59 UTC (History)
3 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 Hossein 2025-03-06 13:34:04 UTC
Description:
LibreOffice .NET SDK examples are bind to version 8.0, which prevents build with .NET 9 or other versions.

Steps to Reproduce:
1. Install .NET 9 SDK and check its version with:
  dotnet --info
2. Build LibreOffice from sources with --enable-odk and .NET support enabled
https://wiki.documentfoundation.org/Development/How_to_build
3. Try building a .NET example like WriterDemo C# example:

$ cd instdir/sdk
$ ./setsdkenv_unix
$ cd examples/dotnet/WriterDemo/csharp
$ make
$ make WriterDemo.run

Actual Results:
You will face error which prevents you from building the example:

----------
You must install or update .NET to run this application.

App: ~/libreoffice25.8_sdk/LINUXexample.out/bin/WriterDemo
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '8.0.0' (x64)
.NET location: /usr/lib/dotnet

The following frameworks were found:
  9.0.2 at [/usr/lib/dotnet/shared/Microsoft.NETCore.App]

Learn more:
https://aka.ms/dotnet/app-launch-failed

To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=8.0.0&arch=x64&rid=ubuntu.22.04-x64&os=ubuntu.22.04
make: *** [Makefile:70: WriterDemo.run] Error 150

Expected Results:
You should be able to build example


Reproducible: Always


User Profile Reset: No

Additional Info:
This shows the target framework version set to 8.0 in the ODK examples:

$ git grep TargetFramework odk
...

If you look into odk/examples/dotnet/WriterDemo/csharp/Makefile for example, you will see:
<TargetFramework>net8.0</TargetFramework>

This should be parametric, for example like application name:
<AssemblyName>$(APP_NAME)</AssemblyName>

Please note that due to tdf#165585, you may not be able to build examples using SDK binaries, and you should build LibreOffice from sources for now.

tdf#165585 - LibreOffice SDK binaries lack cross platform dotnet binding files
https://bugs.documentfoundation.org/show_bug.cgi?id=165585

Please also note that the current stable version of .NET is 9.0.2, released on 12 November 2024:
https://github.com/dotnet/core

To install the latest .NET on your OS, you may need instructions from here:
https://learn.microsoft.com/en-us/dotnet/core/install/


-----------

I am testing with the latest LO 25.8 dev master:
 
Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: f78397068fa7fd403046605fb37620fba7a76e63
CPU threads: 12; OS: Linux 6.2; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: CL threaded
Comment 1 Commit Notification 2025-09-10 19:26:02 UTC
Hossein committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a6b38c4ce7efe58988d8a4110010935973755da4

tdf#165608 Fix .NET examples bound to specific version

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 2 Commit Notification 2025-09-10 21:53:19 UTC
Hossein committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/906436355055e284240f3b806ee482830e0f6e05

tdf#165608 Fix .NET test bound to specific version

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Commit Notification 2025-09-11 09:57:54 UTC
Hossein committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5e210c6598d03d6af0a483783cd70559ffb9585e

tdf#165608 Use DOTNET variable instead of dotnet command

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Hossein 2025-09-16 22:59:01 UTC
The problems should be fixed with the above patches.