在Visual Studio中获取类的程序集合格名称 [英] Getting the Assembly Qualified Name of a class in Visual Studio

查看:92
本文介绍了在Visual Studio中获取类的程序集合格名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为一些特殊的自定义域逻辑编写一个自定义的反射库,该库将使用XML配置文件,这些文件将在运行时动态解析System.Type对象.但是,在编写XML配置文件时,编写类型有些麻烦,因为它们必须是Type.GetType()的完全合格程序集名称才能解析它们.有没有一种方法可以在Visual Studio中找到对象的AssemblyQualifiedName,而无需借助编写程序将它们打印到文件或标准输出或类似的东西中?

I'm writing a customized reflective library for some specialized custom domain logic, and that library is going to use XML configuration files that will dynamically resolve System.Type objects at runtime. However, when writing the XML configuration files, it's a bit of a pain to write the types because they need to be fully qualified assembly names for Type.GetType() to resolve them. Is there a way to find out the AssemblyQualifiedName of an object in Visual Studio without resorting to writing a program to print them out to a file or standard out or anything like that ?

推荐答案

我要将我的评论更改为正确的答案,因为在快速玩了之后,我建议的内容正是您想要的.

I'm gonna change my comment to a proper answer, because after having a quick play what i suggested does exactly what you want.

从此处下载Reflector的免费版本 ,将其解压缩并运行.将程序集的编译版本拖放到该程序集上,对话框底部信息部分中的 Name 标记旁边将是其完全限定名称,供您复制和修改.从那里粘贴.

Download the free version of Reflector from here, unpack it and run it. Drag and drop a compiled version of your assembly on to it, and next to the Name tag in the info section at the bottom of the dialog will be its fully qualified name, ready for you to just copy and paste from there.

请注意,通过右键单击已编译的文件,选择属性,然后转到详细信息选项卡,也可以找到所需的所有信息,尽管您不能这样做.只需从那里复制/粘贴.

Note that all the info you need is also availableby right-clicking on the compiled file, select Properties, then go to the Details tab, although you can't just copy/paste from there.

这篇关于在Visual Studio中获取类的程序集合格名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆