dotnet core c#代码中使用不安全代码 linux 中无法生成 docker生成失败
提示错误:
error CS0227: Unsafe code may only appear if compiling with /unsafe
回答
编辑项目文件
添加如下代码
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
THE END
二维码