Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8294551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T14:15:22+00:00 2026-06-08T14:15:22+00:00

In resolving the question Error Loading ASP.Net Profile I came across behavior of Type.GetType(string

  • 0

In resolving the question

Error Loading ASP.Net Profile

I came across behavior of Type.GetType(string typeName) that I do not understand.

When getting the type of a List<int>, it is sufficient to specify the type as

System.Collections.Generic.List`1[[System.Int32]]

However, for HashSet<int>, I must specify a fully qualified type name like this

System.Collections.Generic.HashSet`1[[System.Int32]], System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

If I leave out any of the assembly, version, culture, or public key token, the type is not resolved.

Code to reproduce

// Returns expected type:
Type tListWorks = 
     Type.GetType("System.Collections.Generic.List`1[[System.Int32]]");

// Returns null:
Type tHashSetNull = 
     Type.GetType("System.Collections.Generic.HashSet`1[[System.Int32]]");

// Returns expected type:
Type tHashSetWorks = 
     Type.GetType("System.Collections.Generic.HashSet`1[[System.Int32]], System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");

// Returns null (omitted Culture):
Type tHashSetNoCultureFails = 
     Type.GetType("System.Collections.Generic.HashSet`1[[System.Int32]], System.Core, Version=4.0.0.0, PublicKeyToken=b77a5c561934e089");

Questions

  • Why must I fully qualify HashSet<T> but not List<T>?
  • Given that the Version qualification must be specified, what if the .NET Runtime is 3.5 (first one that had HashSet<T>) or a later one such as .NET 4.5? What if the runtime is something else entirely like Silverlight or Mono?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T14:15:29+00:00Added an answer on June 8, 2026 at 2:15 pm

    List<T> is defined in mscorelib, HashSet<T> is not.

    As per the documentation:

    If the type is in the currently executing assembly or in Mscorlib.dll, it is sufficient to supply the type name qualified by its namespace

    As for your second question, if you provide a qualified type name to an assembly that is not available in the current framework/profile, GetType will return null.

    The reason behind requiring all the assembly attributes is specified in the Type.GetType documentation (as pointed out by Jason Malinowski in the comments):

    If typeName includes the namespace but not the assembly name, this method searches only the calling object’s assembly and Mscorlib.dll, in that order. If typeName is fully qualified with the partial or complete assembly name, this method searches in the specified assembly. If the assembly has a strong name, a complete assembly name is required.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As well as my question Removing MKMapView Annotations causes leaks. I have discovered that
After resolving issues with RIA installation here , I'm still getting this following error.
I ran into an error that states XPath failed due to: A sequence of
Terribly worded question above (trying to be short). Lets try that again: In Microsoft
All, Question 1 while using templates, Compiler error information is known to be very
This question is linked with the answers in the following question: Error removing Bitmaps[Android]
I am hoping that by asking this question I find a far more effiecient
I've got a one line method that resolves a null string to string.Empty which
I have had a look at Another Question , however the error I am
I initially asked this question on the libRocket forum, but given that further investigation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.