question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Does not seem to work on Linux targeting .NET Core

See original GitHub issue

Seems like the initialization is failing on Linux, I’m targeting netcoreapp2.0, using the NuGet package, and a simple call to any GL API crashes the app (ie. Gl.Initialize will crash it as well).

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:28 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
ForeverZer0commented, Jul 8, 2019

Any fix on the horizon for this? Somewhat related would be the addition of allow users to supply their own loader. For example, a handler that could be passed to the bindings instead of trying to load the natives itself.

public delegate IntPtr GetProcAddressHandler(string functionName);

Popular libraries for context creation such as GLFW handle this responsibility reliably across platforms, and are pretty much the standard for creating native windows/contexts, and would allow easily bypassing this issue.

Had made my own quick/dirty bindings by auto-generated them from the registry, and uses GLFW as the loader works without any issues, where as this can’t even initialize, and BindAPI fails.

1reaction
harry-cppcommented, Mar 16, 2018

And just to make it quick, set OPENGL_NET_INIT to NO. The initialization process should be optional.

And we are back to square one:

Unhandled Exception: System.TypeInitializationException: The type initializer for 'OpenGL.GetGLProcAddressGLX' threw an exception. ---> System.InvalidOperationException: unable to load library at libGL.so.1 ---> System.InvalidOperationException: Exception of type 'System.InvalidOperationException' was thrown.
   --- End of inner exception stack trace ---
   at Khronos.GetProcAddressLinux.GetLibraryHandle(String libraryPath, Boolean throws) in /mnt/Data/GitHub/OpenGL.Net/Khronos.Net/GetProcAddressOS.cs:line 387
   at Khronos.GetProcAddressLinux.GetLibraryHandle(String libraryPath) in /mnt/Data/GitHub/OpenGL.Net/Khronos.Net/GetProcAddressOS.cs:line 376
   at Khronos.GetProcAddressLinux.GetProcAddress(String library, String function) in /mnt/Data/GitHub/OpenGL.Net/Khronos.Net/GetProcAddressOS.cs:line 347
   at Khronos.GetProcAddressOS.GetProcAddress(String library, String function) in /mnt/Data/GitHub/OpenGL.Net/Khronos.Net/GetProcAddressOS.cs:line 149
   at OpenGL.GetGLProcAddressGLX..cctor() in /mnt/Data/GitHub/OpenGL.Net/OpenGL.Net/GetProcAddressGL.cs:line 154
   --- End of inner exception stack trace ---
   at OpenGL.GetProcAddressGL.GetProcAddress(String function) in /mnt/Data/GitHub/OpenGL.Net/OpenGL.Net/GetProcAddressGL.cs:line 73
   at OpenGL.KhronosApi.GetProcAddressGLOS(String path, String function) in /mnt/Data/GitHub/OpenGL.Net/OpenGL.Net/KhronosApi.cs:line 118
   at Khronos.KhronosApi.BindAPIFunction(String path, GetAddressDelegate getAddress, FieldInfo function, KhronosVersion version, ExtensionsCollection extensions) in /mnt/Data/GitHub/OpenGL.Net/Khronos.Net/KhronosApi.cs:line 313
   at Khronos.KhronosApi.BindAPIFunction[T](String path, String functionName, GetAddressDelegate getProcAddress, KhronosVersion version, ExtensionsCollection extensions) in /mnt/Data/GitHub/OpenGL.Net/Khronos.Net/KhronosApi.cs:line 164
   at OpenGL.Gl.BindAPIFunction(KhronosVersion version, ExtensionsCollection extensions, String functionName) in /mnt/Data/GitHub/OpenGL.Net/OpenGL.Net/Gl.cs:line 427
   at OpenGL.Gl.QueryContextVersionCore() in /mnt/Data/GitHub/OpenGL.Net/OpenGL.Net/Gl.cs:line 400
   at OpenGL.Gl.BindAPI() in /mnt/Data/GitHub/OpenGL.Net/OpenGL.Net/Gl.cs:line 337
   at Demo.Program.Main(String[] args) in /mnt/Data/Projects/SdlSharp/Demo/Program.cs:line 22
Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - .NET Core Razor Class Library does not seem to work ...
I have tried to create a .NET Core Razor Class Library. ... Furthermore, in the csproj file, the target framework is set to...
Read more >
NETSDK1045: The current .NET SDK does not support ...
NET SDK does not support 'newer version' as a target. Either target 'older version' or lower, or use a .NET SDK version that...
Read more >
Getting started with .NET for Linux
Microsoft's decision to make .NET Core open source means it's time for Linux developers to get comfortable and start experimenting.
Read more >
.NET Core vs .NET Framework vs .NET Standard: A Guided ...
A guide for understanding the differences between .NET, .NET Core, .NET Framework, .NET Standard, etc. by exploring the history of the platform.
Read more >
Using Rider under Linux: prerequisites
NET SDK does not support targeting .NET Core 2.2. Either target .NET Core 2.1 or lower, or use a version of the .NET...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found