How to enable environment while use C# making plugin for GH?

I’m making a plugin for GH to generate exr file with OpenCVSharp in VS C#. (which for UE5 Vertex Animation Textures)
In visual studio I can add this code, and it worked well in visual studio.

System.Environment.SetEnvironmentVariable("OPENCV_IO_ENABLE_OPENEXR", "1");

But after I build the GHA file and copy it to Grasshopper, the component I mad still get error and said I need to enable openExr.
How to enable it?