MetalamaAPI documentationAdvanced APIMetalama.​Testing.​Aspect­TestingTest­OptionsCheck­Memory­Leaks
Open sandboxFocus

TestOptions.CheckMemoryLeaks Property


Gets or sets a value indicating whether memory leaks should be detected. This features is supported from .NET 6. Leaks are detected by trying to unload the AssemblyLoadContext. If it fails to unload in due time, it means that Metalama or the user code has a static reference to compile-time assemblies. To enable this option in a test, add this comment to your test file: // @CheckMemoryLeaks.

public Nullable<bool> CheckMemoryLeaks { get; set; }
Property Value
Type Description