不安全的代码不会编译上的Visual Studio 2015年 [英] Unsafe code won't compile on Visual Studio 2015

查看:491
本文介绍了不安全的代码不会编译上的Visual Studio 2015年的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编译在新DNX4.6核心程序,但它不会编译由于:

I'm trying to compile a program on the new DNX4.6 core, but it won't compile due to:

错误CS0227:不安全的代码只能出现如果与/不安全

这是我的代码:

This is my code:

    [CompilerGenerated]
    public unsafe class GrayscaleQuantizer : PaletteQuantizer
    {


我已经在网上看了,我不能用同样的问题得到任何来源,因为我有。我不能勾选允许不安全代码在项目属性的Build选项卡,因为没有选择这样做...

I've looked online, and I can't get any source with the same problem as I have. I can't tick the 'Allow Unsafe Code' at the Build tab of the Project Properties, because there is no option to do so...

有谁知道解决方案?

谢谢!

推荐答案

您需要设置allowUnsafe:真正的编译选项在project.json

这篇关于不安全的代码不会编译上的Visual Studio 2015年的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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