473,732 Members | 2,207 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Debug inside a library

Hi all,
I have created a app. project and a library which will be used by the
main project, however i do not know how to get into debug mode inside the
library, although break point is set. is there anywhere to enable the debug
mode into library class.

thanks
rena.
Nov 21 '05 #1
3 1955
As long as :
1) the dll is compiled in debug mode
2) the pdb file for the dll is available
3) you have the source code file
you can debug the dll

All you have to do is create an EXE project to host it. Then in either VS or
the .NET debugger, you can pull up the source file and attach the debugger
to the EXE project. From there on out, it's just like normal debugging.

-Rob Teixeira

"Rena" <Re**@mail.hong kong.com> wrote in message
news:uX******** *****@tk2msftng p13.phx.gbl...
Hi all,
I have created a app. project and a library which will be used by the
main project, however i do not know how to get into debug mode inside the
library, although break point is set. is there anywhere to enable the debug mode into library class.

thanks
rena.

Nov 21 '05 #2
Hi Rob,
Two new project is created, I have already compiled the class library
project in debug mode, and i have another project added a reference to that
library project. (pdb is exist and reside in the class library project's
bin),
but i dont' know why i still can't go into the break point set on the
library project.
any hint?

Thanks.
Rena.

"Rob Teixeira" <RobTeixeira@@m sn.com> ¦b¶l¥ó
news:eN******** ******@TK2MSFTN GP14.phx.gbl ¤¤¼¶¼g...
As long as :
1) the dll is compiled in debug mode
2) the pdb file for the dll is available
3) you have the source code file
you can debug the dll

All you have to do is create an EXE project to host it. Then in either VS or the .NET debugger, you can pull up the source file and attach the debugger
to the EXE project. From there on out, it's just like normal debugging.

-Rob Teixeira

"Rena" <Re**@mail.hong kong.com> wrote in message
news:uX******** *****@tk2msftng p13.phx.gbl...
Hi all,
I have created a app. project and a library which will be used by the main project, however i do not know how to get into debug mode inside the library, although break point is set. is there anywhere to enable the

debug
mode into library class.

thanks
rena.


Nov 21 '05 #3
Are you using 2 instances of Visual Studio?
You can only debug a process (exe) from one debugger as far as I know.
So, basically, there are a few things you can do.

1) Run both projects in the same VS instance. Open one VS instance, open the
EXE project, right-click on the solution in solution explorer, and click Add
Existing Project, and select the DLL project. Now you have the EXE and DLL
project loaded in one solution. Make sure you add the reference in the EXE
project (add project reference). This is the easiest way.

2) Debug the EXE project alone. Open one VS instance and load the EXE
project. Make sure it has a reference to the DLL. Click File->Open->File,
and open the vb file for DLL you want to set the breakpoint in. Now the file
is open in VS, but it doesn't show in solution explorer. If the DLL was
compiled in debug mode and has a valid PDB, you can set breakpoints in the
file and run the project to debug.

3) Debug the DLL project alone. Write a container EXE that references and
uses the DLL. Open one VS instance and load the DLL project. Go to Windows
file explorer and double-click the EXE to run it. Go back VS and click
Debug->Processes, and Attach to the running EXE. Now you can apply
breakpoints in the code and when the EXE gets to those parts of the code, it
will break for you.

-Rob Teixeira

"Rena" <Re**@mail.hong kong.com> wrote in message
news:eM******** ******@TK2MSFTN GP15.phx.gbl...
Hi Rob,
Two new project is created, I have already compiled the class library
project in debug mode, and i have another project added a reference to that library project. (pdb is exist and reside in the class library project's
bin),
but i dont' know why i still can't go into the break point set on the
library project.
any hint?

Thanks.
Rena.

"Rob Teixeira" <RobTeixeira@@m sn.com> ¦b¶l¥ó
news:eN******** ******@TK2MSFTN GP14.phx.gbl ¤¤¼¶¼g...
As long as :
1) the dll is compiled in debug mode
2) the pdb file for the dll is available
3) you have the source code file
you can debug the dll

All you have to do is create an EXE project to host it. Then in either VS
or
the .NET debugger, you can pull up the source file and attach the debugger to the EXE project. From there on out, it's just like normal debugging.

-Rob Teixeira

"Rena" <Re**@mail.hong kong.com> wrote in message
news:uX******** *****@tk2msftng p13.phx.gbl...
Hi all,
I have created a app. project and a library which will be used by

the main project, however i do not know how to get into debug mode inside the library, although break point is set. is there anywhere to enable the

debug
mode into library class.

thanks
rena.



Nov 21 '05 #4

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

Similar topics

3
1468
by: Simon Burton | last post by:
Hi, I'm after a no-op command, so that i can redirect logging commands in performance critical code. Something like this: def log(*args): print args def null_log(*args): pass if not DEBUG: log = null_log
4
4529
by: emma middlebrook | last post by:
I have a question regarding asserting ... here's some code: string GetAssertMessage() { ... prepare a message string and return it... } void SomeMethod() { ...
10
28645
by: John Smith | last post by:
After reading C# documentation the Conditional attribute seemed the way to go, but after inspecting the IL it seems those methods are still there and I imagine the CLR removes them. Using #if DEBUG means the code does not even reach the IL when compiling in release mode. Is there any benefit to using the Conditional Attribute? Am I right in thinking there will small performance overhead using over #if DEBUG.
5
3400
by: Billy | last post by:
Hi! How can I override "Debug.Writeline("Message")" so that will not show that msg in Debug window, but wrote it to a file. I already have a code to write to a file but I would like to use just "Debug" class (same name) for that. Inside of that code I will decide if I will wrote that message to debug window or to a file. I would like to use that two options: -Debug.Writeline("Message", 1) '1 is integer argument from 0-9...
2
1685
by: steve bull | last post by:
how can I debug a code library using C# 2005 Express? I cannot find any way to make the library debuggable - even when I set DEBUG and No Optimize on the debug panel of the code library's property panel. When I try to invoke the library from a windows app it tells me the dll needs to be built using debug. The other alternative would be to set devenv as my startup project for the library but I can find no way to do this with the available menu...
1
2385
by: joemynz | last post by:
Help please with a URLError. Invoking a url that works in Firefox and IE results in a "urlerror 7, no address ..." in python. I need to debug why. Traceback is below. There's a redirect when the url is invoked (it's part of a chain) - you can see it using liveheaders in firefox. What is the best way to debug this? I tried setting debug on HTTPConnection but this doesn't work (from some web posts, setting debug is broken in 2.4). What's...
7
3193
by: Sunil Varma | last post by:
Hello all, I wrote a Windows Service in VC.NET 2005 I want to debug the solution. I tried as mentioned in the following link. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconintroductiontontserviceapplications.asp But, when I started the service I got a message box saying that the service is being stopped.
6
9142
by: Andrew Rowley | last post by:
I am having trouble getting debug and release builds to work properly with project references using C++ .NET and Visual Studio 2003. I created a test solution, with a basic Windows form C++ project. I then add a class library, and add a reference to this project in the first project. When I do a release build, I see the following in the output from the DLL compile: /OUT:"C:\Documents and Settings\Andrew\My Documents\Visual Studio
5
2494
by: Jeff | last post by:
..NET 2.0 I'm working on 3 projects in VS2005: - a windows application project - dll library project - windows service This works like this: The window form call some methods in the dll library project (.net remoting) which again calls the actual objects running in the windows service...
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8774
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9447
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.