A command line tool that gets the full name of any assembly and integrates it into vs. It is a handy tool for getting assembly information.

Source: Internet
Author: User
Tags reflector

I recently visited MSDN and saw this article, which is very practical! Especially for sharepoint developers, how practical this applet is!

All users who do sharepoint development know that sometimes, or often need to obtain the Assembly's public key and all information about the Assembly. For example, if you want to register EventHandler, you must register a security control in the configuration file! All information about the Assembly is required!

Before that, we generally used two methods: (today we will introduce the third method)

1. Copy the assembly to the GAC directory, right-click to view the Assembly's public key, right-click to view properties.

2. Use the powerful Reflector tool. Drag the Assembly into the Reflector tool and you will see:

3. I always feel a waste of time. I always have to perform the operation several times. It's not good! I didn't know the following method before, and it was just like that...

Create a console application GetAssemblyFullName: Enter the following code:

Using System; using System. IO; using System. reflection; namespace GetAssemblyFullName {class Program {static void PrintUsage () {Console. writeLine ("Usage: GetAssemblyName.exe <path and filename> \ n"); Console. writeLine (@ "Example: GetAssemblyName.exe C: \ MyAssembly. dll "); Console. read ();} static void Main (string [] args) {if (args. length <1 | args [0] = "? ") {PrintUsage (); return;} string filename = args [0]; try {AssemblyName an = AssemblyName. getAssemblyName (filename); Console. writeLine ("assembly Full name: \ n"); Console. writeLine (. toString ();} catch (FileNotFoundException) {Console. writeLine ("the Assembly cannot be loaded. Make sure that the project has been compiled! ") ;}Console. Read ();}}}
Generate a project and copy the getassemblyfullname.exe application to a certain location, such as C: \ Program Files (x86) \ Microsoft Visual Studio 10.0 \ Common7 \ Tools \
Open the VS tool:
    1. In Visual Studio, select "external tools" from the "Tools" menu ".

    2. In the "external tools" dialog box, click "add" and enter "Get Assembly full name" for "title.

    3. Navigate to GetAssemblyFullName.exe and fill in the "command" text box.

    4. In the parameter text box, type the following content (case sensitive): $ (TargetPath)

    5. Enable the "use output window" check box.

    6. Click OK ". The new command is added to the tool menu.

Compile the project once, and click tools on the menu bar. You will see the "get Assembly full name" option:
The input window of vs is displayed, and replication is also supported: Is it easier than the previous two methods? ...

 

Technorati labels: gac, sharepoint, dll

 

Link: http://msdn.microsoft.com/zh-cn/library/ee539422.aspx#Y100

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.