Why do I get the error “Unsafe code may only appear if compiling with /unsafe”?

前端 未结 6 2138
猫巷女王i
猫巷女王i 2020-12-12 15:13

Why do I get the following error?

Unsafe code may only appear if compiling with /unsafe\"?

I work in C# and Visual Studio 2008 f

6条回答
  •  情深已故
    2020-12-12 15:57

    To use unsafe code blocks, the project has to be compiled with the /unsafe switch on.

    Open the properties for the project, go to the Build tab and check the Allow unsafe code checkbox.

提交回复
热议问题