Help with debugging application


How do you set VS 2010 to display the error message when an error is encountered while running your code? Presently when there is an error the form is displayed with no error messages.


Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:
can we get more details? You surely have a Try ... Catch somewhere that silently get rid of the error.
You need to have a label or literal control...some control on your form to actually display the errors.

For example, if you have this in your aspx page
<asp:Label runat="server" Id="msg" />

When there's an error in your form, you do something like this
msg.Text = "There's an error".

You have to trap the error in your code behind.

This is just one way of doing it. You can do it other ways depending on your code.
Eric, you and I posted at the same time. I've been using this method you have for years...for different projects:
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Éric MoreauSenior .Net ConsultantCommented:
Camillia, how do you know it is a web app?
AndyAinscowFreelance programmer / ConsultantCommented:
>>Presently when there is an error the form is displayed with no error messages.

Erm - that sounds like my form is showing correctly but there isn't an error.  Why does my code work?  In other words how do you know there is an error?
Agree Eric. I made an assumption.
vcharlesAuthor Commented:

I am trying to avoid using on error Goto, used to receive error message but not certain what setting was removed.
AndyAinscowFreelance programmer / ConsultantCommented:
>>on error Goto...

Unless I am totally mistaken that isn't part of .net in VB.Net error handling possibilities.
What programming language are you using?
vcharlesAuthor Commented:
käµfm³d 👽Commented:
Unless I am totally mistaken that isn't part of .net in VB.Net error handling possibilities.
I'm afraid you are (though it's not recommended)    ; )
AndyAinscowFreelance programmer / ConsultantCommented:
@kaufmed for the info.
Thanks - I'm usually code in C++/C# or VBA.  (Where there is a goto that is to be avoided if at all possible as a rule of thumb)
Éric MoreauSenior .Net ConsultantCommented:
Victor, your latest comment doesn't help much. We know it is VB.Net but is it Web, WPF, WinForms, ....?

Do you have Try..Catch that swallow the error?

Do you know the code that you are expecting it to throw an error?
vcharlesAuthor Commented:
It is a Windows Form.
I am using on error goto instead of try catch.
The error occurs on
Éric MoreauSenior .Net ConsultantCommented:
the "on error" syntax is the old way. You should really use try ... catch as shown in

Catch ex as Exception
end try

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
vcharlesAuthor Commented:
Thanks, changed to try catch. Do i need to import  any files or add anything  in reference  section? Trying to compare both apps but can't  find any differences  so far.
Éric MoreauSenior .Net ConsultantCommented:
no references needed it is part of the core framework
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.