开发者

How to determine which assembly a specific class belongs to?

Often i have a problem that I need to determine which assebmly to include into my project in order to use specific class. For instance I want to you TypeInfo class. MSDN does not say it belongs to. Actually I am not even been able to find TypeInfo class using MSDN document explorer search. All the results relate to some other stuff. For instance first resu开发者_Go百科lt is about System.Runtime.Remoting.

Also MSDN says - assembly mscorlib. In the components page of Add Reference dialog box i can see mscorlib but also fully qualified names like System.RunTime.Serialization

What is the difference?


MSDN absolutely does say which assembly it belongs to, at the top of the page, as well as the namespace. I'm not quite sure which TypeInfo class you're talking about in mscorlib though - this one is in Microsoft.Web.Management.DatabaseManager.dll. Did you mean PropertyInfo or something similar?

Things like System.Runtime.Serialization are still assemblies, but also namespaces. Many types live in an assembly with the same name as their namespace, but that's convention rather than a rule. MSDN tells you both.

For example, PropertyInfo is in the mscorlib assembly, but the System.Reflection namespace - as specified in the page linked earlier.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜