Debug non-source DLL classification using Reflector's Vs.net plugin breakpoint:

Source: Internet
Author: User
Tags reflector

. NET programming tool reflector can decompile. NET-developed applications and DLLs, which are powerful and needless to say. Today I want to test a plug-in breakpoint using Vs.net debugging external non-source DLL (as long as the assembly can be, so exe also line) function.

A Loading the vs.net Reflector plugin

Download the Reflector program from the official website (the latest version of the 6.1.0) package with the Vs.net plug-in, the name "RedGate.Reflector.Addin.dll", open the Red Gate's. Net Reflector program, Select the menu tools->integration options to open the Integration Options dialog, which supports vs2005/2008/2010 three versions of the development environment, which automatically determines which development environments are installed in the current system. If a development environment is not available, the option will be grayed out and prompted "not installed on this computer" before the corresponding options. This article uses VS2008 to experiment, so choose the visual Studio 2008 option. Click OK and it will automatically install the plugin for us. Once installed, the. NET Reflector top-level menu and the right-click menu are added to the VS2008 development IDE.

Note : Once the plug-in is installed, the location of the reflector program cannot be moved, otherwise starting the Vs.net development environment will prompt the plugin has been removed and requires reconfiguration.

Two Create DLL Demo program

Use VS2008 to create a very simple DLL with the following code:

Namespace Dlldemo

{

public class Test

{

public string SayHello (string name)

{

String message = "Hello," + name;

return message;

}

}

}

Three Decompile the DLL demo code and start the breakpoint debugging

    1. You create a new calling program project (REFLECTORTEST.SLN), and then you select menu. NET Reflector->choose assemblies to Debug, a dialog box appears that selects the Assembly, and the. NET that is currently loaded appears by default. The framework namespace, deselect all, because this experiment does not want breakpoints to debug code in the framework. Click the browser button at the bottom left to browse to the dll:dlldemo.dll,.net reflector that you developed in step 2 to automatically start the anti-compilation process, and if you open the Select Assembly dialog box again, The DLLDemo.DLL we selected appears in the list and is selected as shown:

    1. In the newly created project, add the DLL reference that you developed in step 2, adding the following code:

Namespace Reflectortest

{

Class Program

{

static void Main (string[] args)

{

Dlldemo.test Test = new Dlldemo.test ();

String message=test. SayHello ("Roger");

Console.WriteLine (message);

Console.ReadLine ();

}

}

}

    1. In the string message=test above. SayHello ("Roger"); set a breakpoint, run the program, and when you run this line of code, press F11 to step through the Dlldemo's anti-compilation code. A closer look at the top of the test class code page in the IDE is read-only, which is the anti-compilation code.

Postscript:

    1. The latest version of the vs.net. Net Reflector plugin needs to be activated and can be activated with the latest version of the software RedGate.Licensing.exe, for http://yww.qsh.eu/post/2010/03/29/ Redgatelicensingexe.aspx, it is important to note that before activating the software, you need to first click on the installation at the bottom of the RedGate.Licensing.exe software and then fill the activation code into the Red Gate's. Net in Vs.net Reflector the activation window, during the activation process, make sure that RedGate.Licensing.exe is turned on.
    2. Red Gate's. Net Reflector also has a lot of plugins that can be used, depending on the following URL: http://reflectoraddins.codeplex.com/

Debug non-source DLL classification using Reflector's Vs.net plugin breakpoint:

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.