As suggested here https://github.com/dotnet/runtime/pull/46716#discussion_r585228571 Use only the type name + API, without the namespace prefix, if the namespace can be resolved in the current file.