Re: Debug inside a library

From: Rob Teixeira (RobTeixeira_at_@msn.com)
Date: 10/25/04


Date: Sun, 24 Oct 2004 22:40:01 -0400

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" <Rena@mail.hongkong.com> wrote in message
news:eMEY9tiuEHA.3972@TK2MSFTNGP15.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@@msn.com> ¦b¶l¥ó
> news:eNffEyguEHA.1712@TK2MSFTNGP14.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" <Rena@mail.hongkong.com> wrote in message
> > news:uXOWUleuEHA.348@tk2msftngp13.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.
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: Class termination
    ... It has everything to do with forms in the dll. ... The need to make the exe into an ActiveX. ... If your exe needs to reference a dll that is referencing it then ... you've got some *huge* problems in the design of your app. ...
    (microsoft.public.vb.general.discussion)
  • Re: Cant Debug COM Interface
    ... that is loading the dll. ... if I specify the second exe as host application I ... When I start to debug the application the DLL ... > Debugging in this configuration is definitely possible. ...
    (microsoft.public.vsnet.debugging)
  • Debug - Stepping through an exe without the source code - any help
    ... I am looking forward to learn how to debug exe or dll files without the ... source codes. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Design process using Windows Embedded CE 6.0, VS2005, CoreCon and SDKs
    ... This is unrelated to writing applications to run on the device, ... when the DLL or EXE ... Debug and test ...
    (microsoft.public.windowsce.platbuilder)
  • Re: cant bebug a dll
    ... The problem is that the exe is a just startup program, ... The VC debug tool icon start soon becomes enable ... > the VS7 designer to make the DLL preload ability so blindingly obvious ... > have two different MFC runtimes each believing it has the sole correct ...
    (microsoft.public.vc.mfc)