To set the unsafe switch, you will need to look at the project properties. Under the configuration properties\build there is a property allow unsafe code blocks which needs to be set to true to compile unsafe code.