如何使用xbuild
编译使用unsafe
代码的Visual Studio 2010
解决方案?如何编译使用不安全代码的解决方案?
目前我得到这个错误:
Implementation/MaximumImageColorClassifier.cs(35,13): error CS0227: Unsafe code requires the `unsafe' command line option to be specified
但运行:
xbuild -unsafe [solution file]
或:
xbuild /unsafe [solution file]
给出了一个错误:
MSBUILD: error MSBUILD0004: Too many project files specified
xbuild
帮助表明这是正确的语法:
xbuild /? ... xbuild [options] [project-file]
但没有unsafe
选项,并没有“通用”选项提供一些编译标志。
我看到了这个问题:Can I pass an argument to msc through xbuild on the command line?但它没有明确的答案,也许有不安全的代码的特定解决方法?
另外,在我的情况下,xbuild
正在使用dmcs
编译器。