Build error when using BooleanOps.dll

I’m using BooleanOps.dll durng runtime to cut mesh and everything works in editor but when i try to build i get this error

Error building Player: Extracting referenced dlls failed.

ArgumentException: The Assembly UnityEditor is referenced by BooleanOps. But the dll is not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache, BuildTarget target) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/AssemblyHelper.cs:137)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache, BuildTarget target) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/AssemblyHelper.cs:140)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, BuildTarget target) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/AssemblyHelper.cs:172)
UnityEditor.HostView:OnGUI()

The UnityEditor.dll is not available for you at runtime when you build and run your game. Your custom dll seems to be referencing it so it errors out cause it’s not finding it. You could use conditional compilation and wrap any usage of editor codes with #if UNITY_EDITOR ex:

#if UNITY_EDITOR
using UnityEditor;
#endif

// ... somewhere else
#if UNITY_EDITOR
// some editor codes...
#endif