There is a Visual Studio Extension: Code Contracts Editor Extensions
. This extension displays code contracts.
The extension works and displays the code contracts in the ToolTip of a method, but I'm not getting the code contracts in the ToolTip for constructors.
Is there a possibility to display 'Code Contracts' in Visual Studio as ToolTip for constructors?
I´ am using .Net 4.0 in MS Visual Studio 2010 Professional.
Here is the Example-Code:
public Foo(string name)
Contract.Requires<ArgumentNullException>(name != null, "name");
public void Execute(ICollection<int> executedIds)
Contract.Requires<ArgumentNullException>(executedIds != null, "executedIds");
public static void Execute()
var foo = new Foo("foo");
-> Constructor has no Code Contracts displayed in ToolTip
-> Method has Code Contracts displayed in ToolTip