Solved

VB.NET app crashes without warning

Posted on 2012-04-03
19
665 Views
Last Modified: 2012-04-08
I have a VB.NET application that I am always building and improving.  A month or two ago it suddenly started crashing without warning in debug mode rather than breaking in code where the warning occurred.  I cannot figure out what started it or how to stop it.  I don't even know what additional information would help anyone to answer the question except to say that it's a VB.NET Windows forms application running in VS2008 SP3.  Any and all assistance is greatly appreciated!
0
Comment
Question by:pigparent
  • 9
  • 5
  • 2
  • +3
19 Comments
 
LVL 22

Expert Comment

by:plusone3055
Comment Utility
Are you Running Sophos on your machine ?
0
 
LVL 17

Expert Comment

by:nepaluz
Comment Utility
What is the error when the program crashes and when you run it outside the IDE, does it crash as well?
0
 
LVL 42

Expert Comment

by:sedgwick
Comment Utility
did u implement exception handling and error logging in your code?
i'd put some time to implement this stuff which in future will make things alot easier in terms of monitoring your app.
0
 
LVL 1

Author Comment

by:pigparent
Comment Utility
Not running Sophos -- have no idea what that is.

I usually do check the error message in the installed version and just walk through the code until the program vanishes from the screen and then start over with that line as the breakpoint and try to figure it out.  It would be nice if it dropped at that line and gave me the error.

I use error handling and that's not enough to save me.  It still crashes.  I don't use logging because I am new enough that i don't know what I would log and when.  It seems like once it's crashed you can't log anything then...and I don't know what I would want to track up to that point versus what would just bloat my database.  Is there an article you would recommend on this topic?

Thanks to each of you.
0
 
LVL 17

Accepted Solution

by:
nepaluz earned 400 total points
Comment Utility
Run your program outside the debuger andsee what error is thrown. (go to the project's debug or release folders and run the exe from there)
0
 
LVL 1

Author Comment

by:pigparent
Comment Utility
Well, I did that and it told me that it had an overflow error when returning data from Oracle Financials.  I am simply returning pay voucher data with the given SSN, start date, and end date.  It works 99.9% of the time.

I read online that it can be a rounding issue, but there's nothing to round in this query; I am providing a text string and two dates.  I also read that Microsoft stopped supporting the OracleClient for .NET so I switched to the provider released by Oracle.  In debug mode it fails when the very first connection to Oracle is attempted:

Dim conOraclePROD As New OracleConnection(My.Settings.OraclePROD)

I am using:

Imports Oracle.DataAccess.Client (v2.112.2.0)

So obviously I have not published an updated version because the software will fail.  But, without publishing the new version (and making the software for fail for all of my users) I cannot get the error message and have no idea why this isn't working.  That's why I need VS2008 to drop in debug mode and give me the error message.

Thanks again for all of the replies.
0
 
LVL 1

Author Comment

by:pigparent
Comment Utility
nepaluz, thanks so much!  I would have never known to do that.  I ran it that way and it says that 'Unicode' is an invalid connection string attribute.  Now I know my connection string is incompatible with Oracle's .NET provider.  THANKS!  Now, do you know how to get the debugger to activate again instead of the software just crashing?

Thanks!
0
 
LVL 40

Expert Comment

by:Jacques Bourgeois (James Burger)
Comment Utility
For your information, the Oracle .NET provider is marked as obsolete in Visual Studio 2010. That means that it will be dropped in a not so far future. Microsoft suggest switching to the Oracle Data Provider (http://www.oracle.com/technetwork/topics/dotnet/index-085163.html) as soon as you can in order to insure that your application will still work in future versions of the framework.

I do not use Oracle myself, but was told by some of my Oracle students that the conversion from the Microsoft provider to the Oracle provider is not a big job since they are both built on the same base classes.
0
 
LVL 1

Author Comment

by:pigparent
Comment Utility
James, yeah, I mentioned above that I just switched and that was causing my app to not load at all but I discovered that it was a problem in the connection string.  You're right in that it was not a big job.  Very easy, really.  I just wish it were as easy to get VS2008 back to halting in the code and providing hte message at debug time :(
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 83

Expert Comment

by:CodeCruiser
Comment Utility
Can you show a screenshot of the Debug->Exceptions window? Debug menu and click Exceptions.
0
 
LVL 1

Author Comment

by:pigparent
Comment Utility
CodeCruiser, I've attached it.  Would you like for me to expand any particular node?
Doc2.docx
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 100 total points
Comment Utility
Seems fine. Try ticking the "Thrown" tickbox against the common language runtime exceptions. If that does not help, try ticking all.
0
 
LVL 17

Expert Comment

by:nepaluz
Comment Utility
Unicode' is an invalid connection string attribute
Show us how you contruct your connectionstring (if you useany local variables, be sure to include their declarations too)
0
 
LVL 1

Author Comment

by:pigparent
Comment Utility
CodeCruiser, thanks for the suggestion.  I will try that.

Nepaluz, my connection string is working now.  It is:

Data Source=finprod;Persist Security Info=True;User ID=<UID removed>;Password=<pw removed>

I store it in the settings and refer to it in code:

Dim conOraclePROD As New OracleConnection(My.Settings.OraclePROD)

All I did was remove the phrase about Unicode and it worked like a champ.
0
 
LVL 17

Expert Comment

by:nepaluz
Comment Utility
OK, so what is left to resolve then? Am I missing something here?
0
 
LVL 1

Author Comment

by:pigparent
Comment Utility
Nepaluz, VS2008 still does not break in debug mode -- it just silently crashes.  That was the reason for posting here.  I am trying to find out why and get it to halt at the code that is causing the error and give the error message.

Thanks.
0
 
LVL 17

Assisted Solution

by:nepaluz
nepaluz earned 400 total points
Comment Utility
In your instance using Oracle Data Provider, VS IDE debugger will probably not break because the error occurs with the Oracle Data Provider (and its NOT managed code?). I suppose if you can include the code for Oracle Data Provider, then thedebugger would break inside that code. Having said that, have you tried flagging the exceptions as suggested above? If that fails, it may be the case that you can not handle errors originating in the Oracle Data Provider.
0
 
LVL 1

Assisted Solution

by:pigparent
pigparent earned 0 total points
Comment Utility
I've tried, maybe that's it.  Maybe they're concealed on an Oracle thread.  Thanks for all your help!
0
 
LVL 1

Author Closing Comment

by:pigparent
Comment Utility
Thanks for assisting me today!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now