Click to See Complete Forum and Search --> : Error Line Numbers
malleyo
July 9th, 2008, 12:19 PM
Is there an easy way to display the Line Number of where an error occurred? I'm debugging an application, but I can't run the app in the environment. I build the dll and use the dll in another application. I'm trying to figure out where the error is occurring in the dll without being able to set breakpoints and stepping through the code.
I have tried using CurrentStack.GetFrame(0).GetFileLineNumber, but it always returns a 0.
Any help would be greatly appreciated.
sotoasty
July 9th, 2008, 12:29 PM
Try this. Open your app, not the .DLL, then select "FILE", "ADD", "EXISTING PROJECT". Go find your .DLL project and select it to add it to a solution.
Change the reference in your app to reference the Project instead of the .DLL There is a tab for projects when go to add a reference.
From that point on, you can debug both the APP and the .DLL.
Hope this helps.
malleyo
July 9th, 2008, 01:06 PM
Try this. Open your app, not the .DLL, then select "FILE", "ADD", "EXISTING PROJECT". Go find your .DLL project and select it to add it to a solution.
Change the reference in your app to reference the Project instead of the .DLL There is a tab for projects when go to add a reference.
From that point on, you can debug both the APP and the .DLL.
Hope this helps.
The dll project that I need is in a solution with many other projects and I can't bring in just the one I need without getting the rest. Then there's issues with services and such that I don't understand. I have to work with it the way I explained in my first post.
Do you know how I can display line numbers in my error messages?
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.