Building with Code Contracts?

前端 未结 2 2026
我在风中等你
我在风中等你 2020-12-15 20:36

I have the following method:

private void DoSomething(CoolClass coolClass)
{
    if (coolClass == null)
    {
        throw new ArgumentNullException(\"coolC         


        
2条回答
  •  一向
    一向 (楼主)
    2020-12-15 21:04

    By changing following project properties I could eliminate getting this exception while running.

    Right click on project -> Properties -> Code Contract (Tab) change the assembley mode to "Standard Contract Requires" also select checkbox - Perform Runtime contract checking

提交回复
热议问题