BattleFrogue
✅ Debugging exceptions not caught by try-catch
Hi, I have a small piece of code I am having trouble debugging. I have this class:
And the line I am getting the exception on is
CreateInstanceInternal = Marshal.GetDelegateForFunctionPointer<PfnVkCreateInstance>(createInstanceFp);
. The problem I am having is that the exception that is thrown is both not caught by the catch block and doesn't provide any information as to why it throws the exception. I've even stepped through the IL generated for Marshal.GetDelegateForFunctionPointer<PfnVkCreateInstance>(createInstanceFp);
and it passes through all the exception checks that it has. So I would have thought that the function would have succeeded. I'm at a loss as to what to try next. Any ideas?50 replies
✅ What's the performant way of calling into native DLLs in .NET 7?
Hi, I want to learn about making a library that maps a native DLL to be used in C# (namely the vulkan dll. I know things like Silk.NET exist and the like. I mainly want to do it for the educational purposes). I've had a look online and seen a few examples of doing this, but wanted to know what the most performant way of doing this is in modern versions of .NET where for a library like Vulkan you are making many many calls into the Vulkan library each frame. Any advice is appreciated, thanks. 🙂
11 replies