Ɖiamond ǤeezeƦ
Ɖiamond ǤeezeƦ

Reputation: 3331

Webdev.Webserver40.exe crashes when using Code Contracts

Sometimes when debugging with my application I encounter Contract.Requires() failing due to the condition its evaluating returning false (all good so far). However, if I click the Abort button webserver crashes and I get the message: "... has encountered a problem and needs to close ...". Two questions:

  1. Is this the expected behaviour?
  2. If not, what should be the behaviour?

Upvotes: 1

Views: 1319

Answers (1)

Dima Pasko
Dima Pasko

Reputation: 1170

Go to CodeContracts section in your project settings

enter image description here

And uncheck the "Assert on Contract Failure" checkbox in "Runtime checking" section

Upvotes: 1

Related Questions