How to debug custom control?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm writing a custom control in .net cf. Is there anyway I can set break
points on my code and debug it? When I tried to debug it, I got a message
that asked me to set the Start Action (in Project Properties) to Start
External Program which I didn't see it in the dropdown list. I set Debug Mode
to Program and Start Application to my test application, it doesn't work.
Then I added my test project to the solution and set it as startup project,
but the breakpoints in custom control code were marked with question marks
and didn't work.

Thanks,

Lei
 
Thanks Daniel,

The article you mentioned is useful. However what I want to know is how to
debug its runtime functions, not designtime.

Lei
 
Oh, I see. To be perfectly honest I have never done it that way.

Question marks on breakpoints means that the module in which the code
resides is not loaded. So your project is not running against the code you
think it is running. The classic example is referencing a dll rather than
the class library project in the same solution.

BTW, I always create my custom controls manually (not thru the designer) so
there is only one version of them and debugging that way is the same as
debugging against any normal class.

Cheers
Daniel
 
Yes, Daniel. Finally I realized that a custom control is a class library. So
I created a test application, added reference to the library, then added code
manually to create the custom control. By this way, I can debug it. When
debugging is finished, I'll debug its design behavior according to your first
reply.

Thanks,

Lei
 
Back
Top