How to find an assembly name for a .NET namespace, for example, Microsoft.WindowsAzure.ServiceRuntime

不羁岁月 提交于 2019-12-01 20:51:25

问题


I have a generic question, and specific example. This should be easy according to all the similar questions on Stack Overflow regarding assemblies for namespaces. The most common answer is found in question How do I know what reference to include to import a specific .NET namespace?.

"All MSDN doc pages mention namespace and assembly."

However on this MSDN page there is no mention of the assembly. What obvious thing am I missing?

Microsoft.WindowsAzure.ServiceRuntime Namespace

Revised:

More specifically I'm looking for the DLL file to include for the Azure class RoleEnvironment. When I hit F1 and look on its MSDN page MSDN RoleEnvironment, it mentions the Microsoft.WindowsAzure.ServiceRuntime Namespace, but no assembly to include. I've run into things like this before, so I thought I would make it a generic question. Although I do want to know the specific DLL file to reference, I ALSO want to know the answer so I know what to do next time I face this situation.


回答1:


Namespaces don't have assemblies. One namespace can be (and often is) in several assemblies. But specific types are in specific assemblies. So, if you look at the documentation for some type from the namespace you are interested in, you will see in what assembly that type is.

Other types from the same namespace are likely to be in the same assembly, but don't have to be.




回答2:


Namespace: Microsoft.WindowsAzure.ServiceRuntime Assembly: Microsoft.WindowsAzure.ServiceRuntime (in microsoft.windowsazure.serviceruntime.dll)

RoleEnvironment



来源:https://stackoverflow.com/questions/7704456/how-to-find-an-assembly-name-for-a-net-namespace-for-example-microsoft-window

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!