Fixed assembly resolution in CollectUsedTypes.

CollectUsedTypes now correctly resolves references based on the value of
the TargetFramework attribute.