我似乎可以让msbuild来构建不安全的代码块 [英] I can seem to get msbuild to build unsafe code blocks

查看:176
本文介绍了我似乎可以让msbuild来构建不安全的代码块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

msbuild似乎不允许我构建unsafe块,即使我的.csproj指定为:

msbuild doesn't seem to allow me build unsafe blocks even though my .csproj specify:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    ...
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

我的构建命令是:

msbuild myProject.sln /p:Configuration=Release /p:Platform="Any CPU" /t:Clean,Build

推荐答案

您已显示该属性已为 Debug 配置设置.一种选择是 Release 配置中缺少它.

You showed that the property is set for the Debug configuration. One option is that it's missing for the Release configuration.

您还可以在命令行上将平台指定为"Any CPU"(带有空格),而构建文件则需要"AnyCPU".这也可能导致它无法被捡起.

Also you specified the platform on the command line as "Any CPU" (with a space), while the build file requires "AnyCPU". This might also cause it to not being picked up.

这篇关于我似乎可以让msbuild来构建不安全的代码块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆