Unsafe context not kept
Hi,
I am working on a Unity 2018.1 project in Rider and I need to allow unsafe code since I have to use an external c++ dll which uses pointers. My problem is: every time I allow the use of unsafe code from the Project Properties window (both in Debug and Release) it works for 30 seconds then, as I switch file or window, it gets back to being not allowed and I have to open the Project Properties again and again to keep allowing it. I tried manually changing writing <AllowUnsafeBlocks>True</AllowUnsafeBlocks> in the csproj file but it's always brought back to <AllowUnsafeBlocks>False</AllowUnsafeBlocks>.
Is anyone else having the same issue?
Please sign in to leave a comment.
Still a thing in 2025.3.1, that is very promising indeed.
UPD: My bad, Rider probably tries to edit `<AllowUnsafeBlocks>False</AllowUnsafeBlocks>` but as it's managed by Unity, it rolls back. This should be done in Unity.
UPD2: Precisely in Project Settings → Player (???) → Allow “Unsafe” code as of now.