locked
Debugging dll source code RRS feed

  • Question

  • User1102083619 posted

    Hopefully have the correct forum.  Probably a beginner question, but I've been given a web solution with a source library separately.  How do I include the source library in Visual Studio so that I can debug it? 

    I think I am setting the debug parameters correctly since it is opening the web application, but it won't hit the breakpoint in the .dll. 

    I'm sure it's something simple, but after working on it awhile I'm at a loss.  Thanks for any help.

    Thursday, November 15, 2012 10:12 AM

Answers

  • User-166373564 posted

    Hi GeorgeZip

    Base on your description, you have a web solution and two projects( one web application and one class library project), you want to step into the code in the class library. If this is your case, you can add the class library into the web solution via adding an existing project, then the web application and class library in the same solution.

    note:  you need to remove the reference to the dll, re-add the reference to the class library project(Add reference->click Project tab).

    If I misunderstood you or you encounter any problem, please let me know.

    hope it helps you.

    Kind regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 27, 2012 1:08 AM

All replies

  • User-166373564 posted

    Hi

    You should debug the file that creates the dll, other than dll. Please refer this about debug dlls for detailed information.

    hope it helps you.

    Regards

    Friday, November 16, 2012 12:47 AM
  • User1102083619 posted

    Thank you for the response.  My confusion is that it is a web application and does not have an exe. 

    I have tried to debug the dll by attaching to a process and making the start page the calling web application start page, but it never gets inside the source library to hit the breakpoint.   

    Friday, November 16, 2012 8:21 AM
  • User-166373564 posted

    Hi

    When you debug a DLL, you can start debugging from:

    The project used to create the executable that calls the DLL.

    The project used to create the DLL itself.

    If you have the project used to create the executable, start debugging from that project. You can then open a source file for the DLL and set breakpoints in that file, even though it is not a part of the project used to create the executable.

    I think you should get full  understanding of the content in the article. Thanks

    Regards

    Sunday, November 18, 2012 9:13 PM
  • User1102083619 posted

    I appreciate your response. 

    Reading the article it states there are two options:

    • The project used to create the executable that calls the DLL.

    this option does not match mine becasue I have a web application that calls the dll.  No executable 

    The other option:

    • The project used to create the DLL itself.

    I have the project used to create the DLL, but the instructions, again, state  'you must specify the executable you want to use in debugging the DLL', so again the reply to that is that my project is a web application not a windows forms application that has an exe and that would make step 4 of that link impossible.

    So lets assume that I am misunderstanding what the executable is, then from the instructions I would simply start the web application and then open a source file for the dll and set the breakpoints in the file.  I am doing this, but it is not hitting the breakpoints. 

    I believe there must be a middle step somewhere between 'start debugging the executable project that calls the dll'  to 'open a source file for the dll and set the breakpoint.'

    I have created a debug project where I've simply added the source files from the dll within the same project as the web application.  I have to remove the reference to the dll, which does not give me the same set up as what was provided to me, but at least I was able to get moving on it. This seems like a workaround to something that should be easy.

     

    Tuesday, November 20, 2012 8:52 AM
  • User-166373564 posted

    Hi

    Please check the link about How to add an existing project to a solution (Visual Studio) -

    http://msdn.microsoft.com/en-us/library/aa179467(v=SQL.80).aspx

    Kind regards

    Friday, November 23, 2012 3:51 AM
  • User1102083619 posted

    Thanks, so if I've already completed adding an existing project to a solution and my breakpoint still does not get hit then what?

    Monday, November 26, 2012 7:54 AM
  • User-166373564 posted

    Hi GeorgeZip

    Base on your description, you have a web solution and two projects( one web application and one class library project), you want to step into the code in the class library. If this is your case, you can add the class library into the web solution via adding an existing project, then the web application and class library in the same solution.

    note:  you need to remove the reference to the dll, re-add the reference to the class library project(Add reference->click Project tab).

    If I misunderstood you or you encounter any problem, please let me know.

    hope it helps you.

    Kind regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 27, 2012 1:08 AM