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.
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.
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
Please mark the replies as answers if they help or unmark if not.
Feedback to us
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.
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
Please mark the replies as answers if they help or unmark if not.
Feedback to us
GeorgeZip
0 Points
4 Posts
Debugging dll source code
Nov 15, 2012 02:12 PM|LINK
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.
Angie xu - M...
All-Star
20240 Points
1717 Posts
Microsoft
Re: Debugging dll source code
Nov 16, 2012 04:47 AM|LINK
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
Feedback to us
Develop and promote your apps in Windows Store
GeorgeZip
0 Points
4 Posts
Re: Debugging dll source code
Nov 16, 2012 12:21 PM|LINK
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.
Angie xu - M...
All-Star
20240 Points
1717 Posts
Microsoft
Re: Debugging dll source code
Nov 19, 2012 01:13 AM|LINK
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
Feedback to us
Develop and promote your apps in Windows Store
GeorgeZip
0 Points
4 Posts
Re: Debugging dll source code
Nov 20, 2012 12:52 PM|LINK
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.
Angie xu - M...
All-Star
20240 Points
1717 Posts
Microsoft
Re: Debugging dll source code
Nov 23, 2012 07:51 AM|LINK
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
Feedback to us
Develop and promote your apps in Windows Store
GeorgeZip
0 Points
4 Posts
Re: Debugging dll source code
Nov 26, 2012 11:54 AM|LINK
Thanks, so if I've already completed adding an existing project to a solution and my breakpoint still does not get hit then what?
Angie xu - M...
All-Star
20240 Points
1717 Posts
Microsoft
Re: Debugging dll source code
Nov 27, 2012 05:08 AM|LINK
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
Feedback to us
Develop and promote your apps in Windows Store