Code working in editor but not in build, unsafe code problems?

I have a project that works perfectly in the editor but as soon as i make a build the built wont work as expected and it also stops working in the editor. Removing the script and putting it back makes it work again in the editor until i make another build.
Can this problem be because of unsafe code?

I have a dll i need to use and in the interface there are a bunch on unsafe pointers because some functions return values in the arguments. I added the smcs.rsp file with the --unsafe text and also checked “use unsafe” in mono develop and this works very well. Is there a issue with using unsafe code in the Build= And can that be solved somehow? The c# wrapper code i have is not made by me and i don’t want to remake it since its quite a bunch of functions and also i have no idea on how to do that without using pointers.

Anyone?