简体   繁体   中英

How to enable checking for arithmetic overflow globally in the ASP.NET 5 | MVC 6?

There is a setting in the VS2013 MVC5 project:

在此处输入图片说明

It can be opened by

Project Properties -> Build -> Advanced

But I can't find something like it in the VS2015 MVC6 project.

How to enable checking for arithmetic overflow globally now?

In your project.json you can set compiler options . It might be configurable from there. I currently am at my work pc (without asp.net 5), so I can't verify it. I would suggest you use Intellisense to see if it is available.

{
    "configurations": {
        "Debug": {
            "compilationOptions": {
                "define": ["DEBUG", "TRACE"]
            }
        },
        "Release": {
            "compilationOptions": {
                "define": ["RELEASE", "TRACE"],
                "optimize": true
            }
        }
    },
    "compilationOptions": {
        "define": ["SOMETHING"],
        "allowUnsafe": true,
        "warningsAsErrors" : true,
        "languageVersion": "experimental"
    }
}

UPDATE 1

It seems it is currently not supported in the compilations options. If you need this, I suggest you file a issue on github.

Source: https://github.com/aspnet/dnx/blob/dev/src/Microsoft.Dnx.Runtime/Compilation/CompilerOptions.cs


UPDATE 2

You might want to expand on this issue .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM