2011-08-27 35 views
2

是否有任何简单的方法来获取组装的完全限定名称?例如如何获得完全合格的程序集名称

<section name="unity" type=" Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration, Version=2.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 
+0

可能重复[我如何检索程序集的限定类型名称?](http://stackoverflow.com/questions/441680/how-can-i-retrieve-an-assemblys-qualified-type-name) –

+0

可能的重复[如何查找程序集的完全限定名称?](http://stackoverflow.com/questions/658446/how-do-i-find-the-fully-qualified-name-of-an-组装) –

回答

5

This文章(如何:确定程序集的完全限定名称 )可能会帮助你


代码从MSDN

//s if the Fully Qualified assembly name 
Type t = typeof(System.Data.DataSet); 
string s = t.Assembly.FullName.ToString(); 
+0

我添加了代码,以便在答案中可见。 – msarchet

7

这是一个无耻的复制粘贴从I Note It Down并且是获取项目输出的FQAN的简单方法:

Open Visual Studio 
Go to Tools –> External Tools –> Add 
    Title: Get Qualified Assembly Name 
    Command: Powershell.exe 
    Arguments: -command "[System.Reflection.AssemblyName]::GetAssemblyName(\"$(TargetPath)\").FullName" 
    Check "Use Output Window". 

新工具出现在Tools –> Get Qualified Assembly Name下。当选择菜单项时,程序集名称将在输出窗口中给出。

+1

这应该是我认为的接受答案。 – vojta

相关问题