List Info

Thread: How to Debug?




How to Debug?
user name
2006-01-27 13:40:40
I have an application where I have my Windows Forms
Application which
gets its information via a webservice.

For example...

I have my login form which calls the Security Web Service
(Login
Method)

The Web Service then calls the Security Logic (Login Method)
with in
the Business Logic class Library.

The Security Logic then calls the
GetUserbyUserName(username) Method
from the Data Access Class Library

which the Users Data Access uses the Users object from the
Data Class
Library.

End of Example...

My problem is as follows...Each piece compiles fine, but
when I go to
run the code and I try logging in it moves to the web
service and then
goes to the business logic...I know where it is going by
debugging
using breakpoints but can't seem to find the specific point
where the
error is being thrown.

The error that I am recieving is as follows:

Object reference not set to an instance of an object.

How do I debug this sort of thing?

I tried using break points but it won't go to the breakpoint
via the
web service. Not sure why?

I tried using MessageBox.Show() but it gave an error saying
can not
display with application paused or not running or something
like that.

Any information or insight would be greatly appreciated. 

SBProgrammer

How to Debug?
user name
2006-01-27 18:57:25
Well, it is a little bit convoluted but here it goes:
have one solution that have your win forms, web service, and
dal as
separate projects.

Make your webservice as the start project and run the whole
project.
You will get a a browser window explaining the webservice
and also
optiosn to call the different methods of the service.

Set all the break points inside the web service or dal
projects.
Click on the winforms project in your proj manager and then
from the
debug dropdown select start without debugging.

Now whenever your winform app connects to your webapp and
hits a
breakpoint your vs ide will start flashing and you are good
to go.

In case you cannot start the whole thing, and then only the
winapp at
the same time, it will be good to have a separate vs ide
loading only
the winforms and after starting the webservice, you can
start the
winforms one as well and debug both of them.

How to Debug?
user name
2006-01-27 21:17:28
I thank you for the information, but I guess I am blind or
VS2005 they
took out that feature. I started the WS project as you
suggested and
got the webpage viewing the methods. I then went back to the
ide and
clicked on the windows app project went to debug and did not
see that
option. I tried right clicking on the project file and going
to debug
but neither said start without debugging.

How to Debug?
user name
2006-01-27 21:37:44
It is under the Build menu on top. It is both on vs2003 and
vs2005. If
you cannot find it or it doesn't work for you then try to
load the
webservice and data layer in one visual studio solution, and
the forms
in another. Load both solutions in separate instances of the
vs ide,
and then just start both us you would normally do. It is a
little bit
more complicated but it will work just as well (actually
better since
you will be able to debug both of them at the same time.)

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )