Defines that no new instances of the Types that matches the provided name should exist when this definition is asserted using MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread).

Namespace:  SciTech.NetMemProfiler
Assembly:  MemProfiler2 (in MemProfiler2.dll)

Syntax

C#
public void NoNewInstances(
	string typeName
)
Visual Basic
Public Sub NoNewInstances ( _
	typeName As String _
)
Visual C++
public:
void NoNewInstances(
	String^ typeName
)

Parameters

typeName
Type: System..::..String
The type name of the instances that should be checked.

Remarks

Calling MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread) using this AssertionsDefinition will fail if a new instance of a type that matches the provided name exists, unless the type is also included in a call to an AllowXXX or MaxXXX method.
Note Note The name of the Type can end with the wildcard character '*', which allows all types that starts with the specified text to be matched. This can be used to include all types in a namespace (e.g. “System.Windows.Forms.*” will include all types in the System.Windows.Forms namespace).

See Also