How to open unsafe mode in C# for grasshopper

Trying to use pointer in C# for grasshopper, but it seems that Script Editor doesn’t have a unsafe mode button like VS Studio, and it is a failure to add “unsafe” before using pointer.

So how can I open unsafe mode? I didn’t find a tutorials of this in the official documentation website.

I need to add support for compiling unsafe code to the editor. Created this ticket and will implement

RH-84779 Allow unsafe code in C# scripts

1 Like

thanks

In Rhino 8 SR 15, you can add // flag: csharp.compiler.unsafe to the top of script to allow compiling with unsafe

// flag: csharp.compiler.unsafe

using System;
unsafe
{
  int d = 42;
}
1 Like