如题,以下代码中 Console.WriteLine 不执行,不会有输出:
class Program {
static void Main(string[] args) {
Contract.ContractFailed += (sender, e) => {
e.SetUnwind();
Console.WriteLine(e.FailureKind.ToString() + ":" + e.Message);
};
Contract.Requires(args.Length > 0, "必须有参数");
}
}
谢谢!