-
SummaryI use the newest Silk.NET NuGet package (version 1.6.0) and created a VS 2015 project with it (OpenGL). I can debug the project until "window.Initialize()" or "window.Run()" is called, after that the debugger stops with "Application is in break mode" with Additional information: Die Laufzeit hat einen schwerwiegenden Fehler entdeckt. Fehleradresse: "0x6f510c11" in Thread "0x47d8". Fehlercode: 0xc0000005." ("The runtime has detected a critical error"). But If I run the program outside of VS (from Windows Explorer) the process is stable (and runs normally). And the second crash appears if I call (inside Load event): I can debug (step over) that line, but after showing the window the process crashes with And outside of VS the same happens, the process crashes (but without any message). So I can't use any input... Steps to reproduce
CommentsAdd any other context about the problem here. |
Beta Was this translation helpful? Give feedback.
Replies: 15 comments
-
The first error I'm absolutely clueless as to why that's happening, but the second error seems like a really rare bug encountered with the 1.X input backend where some memory we need is freed prematurely by the runtime, try one of the 2.0 previews to see if you can reproduce this. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your fast response. After updating the NuGet references to "2.0.0-preview2" (and changing some method parameters) "window = Window.Create(options);" now throws an PlatformNotSupportedException: Btw: Do I understand it correctly (#310), that you also will (or have) implement(ed) a Direct3D binding for Silk.NET 2.0? |
Beta Was this translation helpful? Give feedback.
-
Interesting. What packages are you referencing? In Silk.NET 2.0, we've moved to a soft dependency model instead of our previous "stiching assembly" model. Also do you know the message and stack trace of the PlatformNotSupportedException? Yeah, per our 2.0 goals outlined in #48, #310 introduces DirectX bindings. Currently in that PR, there are some complete (but untested currently) bindings to Direct3D 9, 11, and 12. |
Beta Was this translation helpful? Give feedback.
-
This is the content of the "packages.config":
The exception message is just "Couldn't find a suitable window platform. https://docs.ultz.co.uk/Silk.NET/windowing/troubleshooting.html" (but this site is unavailable for me ;-( ).
I've also tested it with VS 2017 and I get the same platform exception (after a full clean and rebuild). What is exactly meant by "platform not supported"? I've developed an UI library and the Win GDI+ (WinForms) renderer is working and now I'm trying to implement other renderers (OpenGL, Vulkan, DirectX) for it. And if DirectX is supported in future with Silk.NET 2.0 I don't have to use another lib (and that would be great ;-). I'm waiting for .NET 5 and the next Visual Studio version (like many other people), but for now I use VS 2015 (I don't want to install VS2019 and in a few month another new VS ;-). PS: I'm getting the warning "The referenced component 'System.Runtime.InteropServices.RuntimeInformation' could not be found." (but also with Silk.NET 1.6, so I've ignored this warning so far). |
Beta Was this translation helpful? Give feedback.
-
Could be related to #192 |
Beta Was this translation helpful? Give feedback.
-
Specify |
Beta Was this translation helpful? Give feedback.
-
The "glfw3.dll" (32-bit) is already in the bin/debug (and release) folder (tried it also with the 64 bit version). With 1.6 I got another exception for that: "GLFW: Copy a GLFW 3.3 binary into the same directory as ExampleApp". And isn't Edit: But even with |
Beta Was this translation helpful? Give feedback.
-
That's not the correct usage of RuntimeIdentifier, you want something like win-x64 in there. If that doesn't work you'll have to see if you can get more insight. Specifically, if any first chance exceptions are being thrown and caught silently (they'll contain valuable info) and if Silk.NET.Windowing.Glfw.dll is being loaded or not. |
Beta Was this translation helpful? Give feedback.
-
I've now tried with "win", "win-x32", "win-x64" and even "win10", "win10-x32" and "win10-x64" (according to Windows RIDs), but all give the platform exception. But just for clarification: I've put the
and then rebuilded and started the "Debug" configuration. And in the "Module" list, only (from Silk.NET libraries)
are loaded. And in comparison with my running Win-GDI+ project, there are a lot more (> 20) entries of:
|
Beta Was this translation helpful? Give feedback.
-
For older csproj, you may need <Platform> / <PlatformTarget> or something similar. You should probably convert the project to use the ".NET Core" csproj format (which is not specific to .NET Core, it's just not backwards compatible - not sure if VS 2015 can support it) and <TargetFramework>net461 If you want to upgrade your csproj, if you post your full csproj I can post what it should be converted to. You can check the UltralightSharp repo for an example that uses Silk.NET and see how the standard build process deploys the library in the bin dir. While the Silk.NET demo project is .NET Core, the project library itself is set up and tests (deploys properly) in CI on Linux/Mac/Win for .NET core as well as for .NET Fw under the GH windows runner just by normally building and running. Can check the Actions tab to see the results. |
Beta Was this translation helpful? Give feedback.
-
Also with No, VS 2015 can't support directly .NET Core projects (it can use NuGet Standard 2.0 projects, but one cannot create or use .NET Core projects). I've added my current csproj file (it is a class library): Btw: This seems to be a really confusing thing: Design/Doc issue: PlatformTarget vs Platforms vs RuntimeIdentifier handled inconsistently |
Beta Was this translation helpful? Give feedback.
-
Now I reverted back to v1.6 and tried to use Vulkan:
But at
|
Beta Was this translation helpful? Give feedback.
-
You're trying to use OpenGL with a window configured for Vulkan. |
Beta Was this translation helpful? Give feedback.
-
OK, I need something like And is there a common interface for both or do I have to develop different code for both APIs? |
Beta Was this translation helpful? Give feedback.
-
We haven't published an official example, however there is a Vulkan test application in the src/Lab/VulkanTriangle directory You'll need to develop for both separately, Silk.NET is nothing more than a bindings library do you'll need to create the common API layer yourself |
Beta Was this translation helpful? Give feedback.
We haven't published an official example, however there is a Vulkan test application in the src/Lab/VulkanTriangle directory
You'll need to develop for both separately, Silk.NET is nothing more than a bindings library do you'll need to create the common API layer yourself