Reputation: 3842
Me stupid.
How can I know which assembly to reference if I just know the name of the class, for example System.Collections.Specialized.StringCollection
.
(Yes, I know that more often than not I can make an educated guess by looking at the namespace.)
Thanks
Alex
Upvotes: 8
Views: 4851
Reputation: 671
Tested in VS 2008:
EDIT:
Upvotes: 3
Reputation: 162
What I usually do is right-click the "StringCollection" in the editor and click "Go To Definition" then a window will pop up with the title "StringCollection [from Metadata]" then I just hover the mouse pointer to the title and a tooltip appears with the location of the assembly where the class comes from.
Upvotes: 10
Reputation: 116220
Usually you can't since most assemblies contain multiple namespaces. Take the example of the System.Core.dll that was added in .net 3.5. It added additional classes to System.Collections.Generic. Some of the original classes lived in the mscorlib.dll One quick way to find out though would be to open up the "Object Browser" tab in VisualStudio, and click the little "Settings" toolbar button, and makes ure "View Containers" is checked.
Upvotes: -3
Reputation: 176269
You can check in MSDN: The assembly containing the class is mentioned right at the top:
StringCollection Class
Represents a collection of strings.
Namespace: System.Collections.Specialized
Assembly: System (in System.dll)
Upvotes: 7