473,320 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Debugging external classes

I'm having troubles getting the debugging process to work consistenly for
external classes. I got it to work once and then I turned it off. But now I
can't get re-enabled. Here is what I'm doing. If someone could tell me what
I'm missing that would be great.

1. Create an external class and call it Test.dll.
2. Create a test Asp.net app called App.sln.
3. For App.sln I set a reference to Test.dll.
4. Compile App.sln and run it. The web page opens and it cals Test.dll fine.
5. Go back into Test.dll and set the Config/Debug properties to be:
Debug Mode - URL
Start URL - http://localhost/app/Index.aspx
6. Set a breakpoint in Test.dll.
7. Run Test.dll and the web page starts but the breakpoint doesn't get
triggered.

This didn't work, so I go back into Test.dll and try the following:
8. Set the Config/Debug properties to be:
Debug Mode - Project
Start Page - http://localhost/app/index.aspx.
9. I try to run Test.dll and get an error that it can't be run directly so
instead I launch the web app manually. The breakpoint doesn't get triggered.

I'm stuck here. The time it DID work I was when I ran the web page and it
immediately found the breakpoint in Test.dll and paused execution on the
proper line of code in Test.DLL. But I can't figure out how to recreate this
and I'm going around in circles. My breakpoints are always ignored.

Thanks for any help.

Brian

Dec 8 '05 #1
3 1700
double check that you are compiling in Debug and not Release.

Dec 8 '05 #2
Yeah, I definitely have that taken care of and it copies the .pdb file to
the local directory. So are you implying that what I'm doing is right? It's
so strange b/c the first time I did this it worked fine and I just assumed
it was a trivial exercise. But now that it doesn't work anymore I'm racking
my brain trying to figure out what is different this time.

Brian
"john_teague" <jc******@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
double check that you are compiling in Debug and not Release.

Dec 8 '05 #3
Over the past couple of hours I learned some interesting points about
debugging external DLLs/classes.

1) If the app is fairly complex where you have multiple DLLs you can run
into problems if you aren't careful with cross-referencing. For any
supporting DLL that references another DLL, set Copy Local=False. Otherwise
when you compile the main app, it tries to copy the DLLs on top of each
other and reports errors. It looks like when it loads a DLL then it tries to
load all the DLLs in the same folder since they are referenced. The only
place where you can set Copy Local=True is in the main app.
2) To debug an external DLL, the main app must reference it with the DLLs
bin folder. If you reference the copy from the main app's local folder then
it won't debug it. I say this b/c you have to double check the folder
location. I have one DLL that I reference from it's bin folder and
everything looks great. But when I compile the main app it overwrites the
folder reference and makes it point to the app's folder. All my other DLL
references still reference the appropriate bin folder, but this one DLL
keeps getting its reference overwritten after I compile the app and I can't
figure out why. Consequently, I can't debug this DLL b/c it isn't
referencing the DLL's bin folder.
3) When changing the Config|Debug property DebugMode, you have to click the
Apply button after selecting the property from the dropdown list. The other
textboxes below it stay disabled until clicking the Apply button, This drove
me crazy for a full day b/c I would say that I want the debug mode to be URL
and the URL property stayed disabled and I couldn't specify the URL address.
I finally got lucky and clicked Apply by mistake and saw that the URL
property immediately became enabled. I would say this is a bug and I hope
they fixed it in 2.0 b/c it's a tough one to figure out.
4) Another way to debug a DLL is to do it within a single instance of the
IDE and running the main app. Add the DLLs project to the main app's
solution to debug the DLL. Again, this only works if the main app is
referencing the DLL from the DLLs bin folder.
5) If you follow all the rules above, then you can open DLL in the IDE and
the option to debug from an external URL or an EXE works fine. Run the DLL
and the appropriate URL or EXE will open and your breakpoints will be hit.
In my earlier posts I reported that this wouldn't work, but that was because
rule #2 above wasn't being followed.
Hope this little FAQ helps anyone struggling to debug DLLs like I did for
the past two days.
Brian Bischof
www.CrystalReportsBook.com

"Brian Bischof" <bi******@hotmailx.com> wrote in message
news:us**************@TK2MSFTNGP10.phx.gbl...
Yeah, I definitely have that taken care of and it copies the .pdb file to
the local directory. So are you implying that what I'm doing is right?
It's so strange b/c the first time I did this it worked fine and I just
assumed it was a trivial exercise. But now that it doesn't work anymore
I'm racking my brain trying to figure out what is different this time.

Brian
"john_teague" <jc******@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
double check that you are compiling in Debug and not Release.


Dec 9 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
16
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
1
by: DEWright_CA | last post by:
I have built a pretty basic site and now when I try t debug it I get a error that says; {0}: Build (web): "The type initializer for 'System.Web.Compilation.CompilationLock' threw an exceptoin. ...
6
by: Brian Bischof | last post by:
I'm having troubles getting the debugging process to work consistenly for external classes. I got it to work once and then I turned it off. But now I can't get re-enabled. Here is what I'm doing....
23
by: keyser_Soze | last post by:
I have MS Visual Studio 2003 on Windows XP Pro. I have IIS running on this machine and I am trying to debug some existing code which has both ASP and ASP.NET components. When I try and launch...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
0
by: Ken Allen | last post by:
The MSDN documentation on remote debugging is a bit sparse, to say the least, and there is almost no information available on the 'best' way to configure this. I should note that my development...
2
by: A_StClaire_ | last post by:
wow, surprised I wasn't able to find half a dozen posts on this. maybe I'm just not searching the right terms. I'm wondering how to force VS 2005 to debug my C# website IIS-style. that is, to...
3
by: vbMark | last post by:
Hello, I am debugging an ASP.NET application with many pages and classes. There is a method that I am working on, but I must know what happened just before this method was called. I am using...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.