How to compile a Visual Studio 2010
solution using xbuild
that uses unsafe
code?
Currently I get this error:
Implementation/MaximumImageColorClassifier.cs(35,13): error CS0227: Unsafe code requires the `unsafe' command line option to be specified
But running:
xbuild -unsafe [solution file]
or:
xbuild /unsafe [solution file]
Gives an error:
MSBUILD: error MSBUILD0004: Too many project files specified
xbuild
help shows that that's the proper syntax:
xbuild /? ... xbuild [options] [project-file]
But there is no unsafe
option, and no "generic" option to provide some compilation flags.
I saw this question: Can I pass an argument to msc through xbuild on the command line? but it has no definite answer and maybe there is a specific workaround for unsafe code?
Also, in my case xbuild
is using dmcs
compiler.