-2

I found these two links to a description of System.Type:

These descriptions list different members. For example:

  • The .NET Standard version has a Name property, but the .NET 10 version doesn't.

  • The .NET 10 version has a FullName property, but the .NET Standard version doesn't.

Interestingly, I can access both properties:

List<int> l = [];
Type g = l.GetType();
Console.WriteLine($"Name:{g.Name}\nFullName: {g.FullName}");
Console.WriteLine("Generic arguments:");
Console.WriteLine($"Generic type: {g.GetGenericArguments()[0].Name}");

When I read the description for .NET 10 only, I wouldn't know that a Name property exists.

Can someone please explain what the different class descriptions mean? I run Windows 11.

8
  • 3
    When I follow those links, both list Name and FullName in the property list, Commented 13 hours ago
  • 4
    In .NET 10, Type is derived from MemberInfo, which declares Name. You can see Name in the complete list of properties at learn.microsoft.com/en-us/dotnet/api/… Commented 13 hours ago
  • 2
    Looking at the docs you've linked to, both pages list both Name and FullName in the list of properties. Commented 13 hours ago
  • 2
    "has a Name property, the .NET 10 version hasn't" - in the Properties table in the doc - "Name - Gets the name of the current member. (Inherited from MemberInfo)" Commented 13 hours ago
  • 2
    @TimSchmelter Are you looking at the left side tree or the properties table in the page? The contents tree does not show inherited members, but the tables on members in the page does, thus the tree is less useful. The .NET documentation has long been like that. Commented 13 hours ago

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.