relife87
Topic Author
Posts: 8
Joined: 17 Aug 2021, 18:27

.NET 5.0 Cross Platform (linux)

11 Oct 2021, 02:21

Hi, have the problem - i'm try compile NET 5.0 app with noesis library but have invalid library problems
- native(.so) have problem on step load fonts
- from managed sdk(dll) have problem on Noesis_GetCurrentThreadId - System.DllNotFoundException
Can help me? in Windows 7+ no have any problems, i'm try download managed code from repository(for tests) and watch problems, at linux native libs dllimport calls is works fine

Updated: Noesis package ver 3.1.1
 
relife87
Topic Author
Posts: 8
Joined: 17 Aug 2021, 18:27

Re: .NET 5.0 Cross Platform (linux)

12 Oct 2021, 21:05

App code, dead on -> return new XDisplay();
partial class App : Application
    {
        protected override Display CreateDisplay()
        {
            return new XDisplay();
        }
        protected override void OnLog(LogLevel level, string channel, string message)
        {
            if (string.IsNullOrEmpty(channel))
                Logger.Log($"{Enum.GetName(level)} - {message}");
#if DEBUG
            base.OnLog(level, channel, message);
#endif

        }

        protected override RenderContext CreateRenderContext()
        {
            if (RuntimeInformation.OSArchitecture == Architecture.Arm ||
                RuntimeInformation.OSArchitecture == Architecture.Arm64)
            {
                return new RenderContextEGL();
            }
            else
            {
                return new RenderContextGLX();
            }
        }

        static void Main(string[] args)
        {
            App app = new App();
            app.Uri = "App.xaml";
            app.Run();
        }
    }
From debug (native(.so))
- Dead on XDefaultScreen without exception, return IntPtr.Zero(null), may be it's wsl problem (but i configure desktop for X11 work, and tests another app), fixed - replace null arg to $DISPLAY console content, may-be need replace Display.cs
_display = XOpenDisplay(null);

            int screenNumber = XDefaultScreen(_display);
to
 _display = XOpenDisplay(<constructor arg>);

            if (_display == IntPtr.Zero)
                throw new Exception("cannot connected x11 server");
                
            int screenNumber = XDefaultScreen(_display);

- Dead on without exception on file FontProvider.cs
  private void RegisterFontHelper(string folder, string id) {
    NoesisGUI_PINVOKE.FontProvider_RegisterFontHelper(swigCPtr, folder != null ? folder : string.Empty, id != null ? id : string.Empty);
  }
  
 
User avatar
sfernandez
Site Admin
Posts: 2387
Joined: 22 Dec 2011, 19:20

Re: .NET 5.0 Cross Platform (linux)

13 Oct 2021, 10:56

I've created ticket #2147 to track this issue, could you please create an account in our bugtracker to monitor it.
We'll try to replicate the problem on our end, if not we'll ask for your help in the ticket.

Who is online

Users browsing this forum: No registered users and 2 guests