IL2004: Could not resolve dependency type specified in a 'PreserveDependency' attribute

Cause

The type specified in a PreserveDependencyAttribute could not be resolved.

Rule description

Trimmer keeps a cache with the assemblies that it has seen. If the type specified in the PreserveDependencyAttribute is not found inside an assembly in this cache, the trimmer does not have a way to find the member to preserve.

Example

// IL2004: Could not resolve dependency type 'NonExistentType' specified in a 'PreserveDependency' attribute
[PreserveDependency("MyMethod", "NonExistentType", "MyAssembly")]
void TestMethod()
{
}