msbuild似乎不允许我构建unsafe块,即使我.csproj指定:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
...
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
Run Code Online (Sandbox Code Playgroud)
我的构建命令是:
msbuild myProject.sln /p:Configuration=Release /p:Platform="Any CPU" /t:Clean,Build
Run Code Online (Sandbox Code Playgroud)