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 ?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
If I were in your situation I would just popup the Immediate Window (Debug->Windows->Immediate) and use
typeof(TypeFullName).AssemblyQualifiedName
.You need to qualify the type with the full namespace in order to do this and this also has the side effect of automatically running the solution startup project. This side effect can be mitigated by temporarily setting a class library as the solution startup project.
Example:
I'm not sure if I understood the problem. You want to get full names of your types programmatically? If so, you can always use
typeof(YourType).FullName
ortypeof(YourType).AssemblyQualifiedName
.What I can think of is marking all of types you need with some custom atribute to easyly find them in the assemblies to extract their names, I don't think you can find some way without going through each of the type you need to extract its name.
I'm gonna change my comment to a proper answer, because after having a quick play what i suggested does exactly what you want.
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.