How to step into a Dll ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter

    #1

    How to step into a Dll ?

    I write some codes and compiled them into a DLL file,also I have a project
    to reference the dll. They can work fine. Now I want to add some functions
    to the DLL and debug it, but I can't step into the DLL source line.

    Anyone can help me? Thanks in advance.

    Peter


  • Herfried K. Wagner [MVP]

    #2
    Re: How to step into a Dll ?

    "Peter" <zlxmqyt@sina.c om> schrieb:[color=blue]
    >I write some codes and compiled them into a DLL file,also I have a project
    > to reference the dll. They can work fine. Now I want to add some functions
    > to the DLL and debug it, but I can't step into the DLL source line.[/color]


    Add an EXE project to the solution, reference the DLL project and start
    debugging for the EXE project. In addition, take a look at "Project" ->
    "Properties " -> "Configurat ion settings" -> "Debugging" .

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://classicvb.org/petition/>

    Comment

    • Mythran

      #3
      Re: How to step into a Dll ?


      "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
      news:ex9zMYv3FH A.472@TK2MSFTNG P15.phx.gbl...[color=blue]
      > "Peter" <zlxmqyt@sina.c om> schrieb:[color=green]
      >>I write some codes and compiled them into a DLL file,also I have a project
      >> to reference the dll. They can work fine. Now I want to add some
      >> functions
      >> to the DLL and debug it, but I can't step into the DLL source line.[/color]
      >
      >
      > Add an EXE project to the solution, reference the DLL project and start
      > debugging for the EXE project. In addition, take a look at "Project" ->
      > "Properties " -> "Configurat ion settings" -> "Debugging" .
      >
      > --
      > M S Herfried K. Wagner
      > M V P <URL:http://dotnet.mvps.org/>
      > V B <URL:http://classicvb.org/petition/>[/color]

      Another way to step into a DLL assembly would be to open up it's project
      settings and change the output type to Console Application. Then add a
      Public Shared Sub Main() method to it. Create an instance of the class
      inside the Main method and call the methods you wish to test. This may take
      a bit longer to do, but doesn't require you to add another project. Also,
      you will have to reset those changes prior to releasing it...because it will
      be compiling to a .exe and not a .dll :)

      HTH,
      Mythran

      Comment

      • Phill.  W

        #4
        Re: How to step into a Dll ?

        "Peter" <zlxmqyt@sina.c om> wrote in message
        news:O6HBSVv3FH A.3876@TK2MSFTN GP09.phx.gbl...[color=blue]
        > I write some codes and compiled them into a DLL file,also I have a project
        > to reference the dll. They can work fine. Now I want to add some functions
        > to the DLL and debug it, but I can't step into the DLL source line.[/color]

        For a "local" DLL (one that doesn't get added to the Global
        Assembly Cache), change the "Start Action" [Project] settings to run
        a program that /uses/ your DLL. Add breakpoints to the DLL code
        and run ...

        For a DLL that /does/ go in the G.A.C. (like most of mine), the
        same principle applies, but you have to remember to re-"register"
        the DLL in the G.A.C. after every build.

        HTH,
        Phill W.


        Comment

        • wooster11

          #5
          Re: How to step into a Dll ?

          Since you already have a project that you're running and have made
          changes to your DLL, you'll just want to rebuild your DLL in Debug
          mode. After that, make sure that your other project that references
          this DLL, get's a reference to the Debug version. Tip: If you have
          the Copy Local property set to true on this reference, simply change it
          to False, then change it back to True. This will tell Visual Studio to
          get a new copy of that DLL. It will now have the Debug version, and
          you can step into any method of that DLL.

          Comment

          • Peter

            #6
            Re: How to step into a Dll ?

            Now I can debug my Dll source line by seting the DLL project's "Start
            Action" to use my Exe project. Thank you,I'm proud of you.

            Peter



            Comment

            Working...