Nolram
Explore posts from serversP/Invoke boolean call always returns true in Release builds
I have a simple boolean function in a native C++ DLL (for keyboard input in my case), which I P/Invoke from C#.
In debug builds, everything works fine.
But in a release build (of both the C# and C++ projects), the C# side always receives true from the P/Invoke call, even when the native side returns false.
I've checked my build settings but I can't figure out what is happening here- any recommendations for how to debug this or what could be the potential cause?
For reference - my code looks a little bit something like this:
C++:
C#:
Please ping me on reply, thank you!
13 replies
Getting a (very) high resolution timer in C#
Hello folks! I'm currently working on some numeric-integration related stuff (specifically, creating a fixed timestep system for a game), and in order to be able to correctly interpolate subframes between steps (and we're talking about 120-240 steps per second), I need some high resolution timer - preferably sub-milisecond precision!
Does anyone have recommendations for facilities in .NET that would allow me to get such a timer?
(Please ping me on reply, thank you in advance!)
35 replies
Removing implicitly installed NuGet packages / Ignoring dependencies
Hello! I'm currently trying to install a NuGet package that has a dependency that I would like to not install into the project from NuGet, as I already have a local, modified copy of that same package. Is there some way I can remove this implicitly installed package or ignore the package in the first place?
5 replies
Async operations cause errorless crash (Task.Run etc.)
I am currently attempting to load about ~190MB worth of byte data from a file and decrypt it asynchronously. Loading the data using byte[] fileBytes = File.ReadAllBytes(...).ConfigureAwait(false) seems to work just fine - however, attempting to run the AES decryption on it with byte[] decryptedBytes = await Task.Run(() => DecryptionFunction(...))).ConfigureAwait(false); causes a crash without any error - not with a managed debugger (Rider) or Native Debugger (VS) or in the log files Unity provides.
63 replies