The following is an example I have created in order to get the static analysis tool to fail:
using System.Diagnostics.Contracts;
using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
object x = null;
Contract.Assert(x != null);
}
}
}
Runtime analysis throws the correct exception but static analysis builds without even a warning. I have every checkbox selected in the project settings, and the warning level on "hi". I am running version 1.4.51019.0.
What do I need to do to get compilation to fail?