Unsafe code won't compile on Visual Studio 2015

后端 未结 2 1515
天涯浪人
天涯浪人 2021-01-17 14:26

I\'m trying to compile a program on the new DNX4.6 core, but it won\'t compile due to:

error CS0227: Unsafe code may only appear if compiling with /unsafe

相关标签:
2条回答
  • 2021-01-17 14:57

    You need to set "allowUnsafe": true in the build options in project.json.

    0 讨论(0)
  • 2021-01-17 14:57

    I wasn't smart enough to be able to figure it out with the help above. I did find that if you go to the solution explorer window and right click on properties, the one just above references, there will be an option to open. Click that one and then click on Build on the left. Allow unsafe code is on about the fifth line.

    0 讨论(0)
提交回复
热议问题