473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Unhandled Exception Not Being Caught

I'm still looking into this problem, but to summarize:

I wrote a very simple Windows Service in VB.NET, as part of a larger
application. I created a deployment project for the application the
resulting MSI explicitly installs the service. I've ran the installer
on 4 machines at our office (2 are running Windows 2000 Pro, 1 is
running XP Pro, and the other is running Windows 98). On each of these
machines, the installation goes without a hitch and the application
runs fine (the Windows Service basically runs a timer with a 1-minute
interval -- each minute, it checks a registry value to see whether or
not it should run a particular EXE, using the
System.Diagnostics.Process.Start(string) overload, i.e. it's a very
simple task scheduler so to speak). The service runs great on the 4
previously-mentioned machines, and when it decides it's time to run the
other EXE, it works without a hitch. However, when we installed the
application on a customer's machine (running Windows 2000 pro), the
service runs fine until it comes time to fire off this other EXE. At
that point, an UnhandledException is quietly logged in the Event Log -
the EXE it is supposed to fire off starts and then stops almost
instantaneously. I should note that the EXE which this scheduler
service fires off is a .NET application, and it is in the same
directory as the scheduler service's EXE. The problem is:

a) the message in the Event Log is extremely unhelpful: it amounts to
saying that an UnhandledException occurred and that it (supposedly)
occurred in the EXE which the scheduler service attempts to fire off.
There is no explanation of *what* the exception actually is.

b) the EXE which the scheduler service fires off has a Sub Main as its
startup object. I wrapped all the code in Sub Main in one big
Try...Catch e As Exception block, to provide a quick-and-dirty
"catch-all" mechanism, thinking I could catch this mysterious unhandled
exception. The strange thing is that catching Exception doesn't catch
the unhandled exception!! Do I need to explicitly add an
AppDomain.UnhandledException handler or something similar (I'd try that
now, but I'm not at work) ? In any event, I don't understand how the
exception still goes unhandled, even when I explicitly catch the base
Exception class in Main.

Again, this issue can only be reproduced on our customer's machine (go
figure...) and we've been having a heck of a time seeing what else
could be causing the issue. On that note, we did notice that this app
we're installing shows up twice in the .NET Wizard's "Fix This App"
list of currently-installed managed apps. One entry shows up for the
current version (which is installed to Program Files), and another
entry shows up for an older version of the application (back then it
was also installed to a different directory). The problem here is that
the second entry shouldn't be showing up: the previous version was
completely uninstalled and we can't find any dangling references to it
anywhere, not on the hard drive, not in .config files, not in the
Registry, nowhere...I'm digressing from my original question, but does
anyone know how to remove the duplicate entries and for that matter
*how* that list of managed application is built, i.e. where it pulls
the data from which it builds the list? We think this duplicate entry
issue could be the real problem, since we've encountered this issue
before with other .NET applications.

--
Mike S

Jul 27 '06 #1
0 1427

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: RalphTheExpert | last post by:
I'm getting different behavior if my code is running under the debugger or not. I have modified Winmain to look like this: // Copyright (C) 2002 Microsoft Corporation // All rights reserved....
5
by: Lucvdv | last post by:
Can someone explain why this code pops up a messagebox saying the ThreadAbortException wasn't handled? The first exception is reported only in the debug pane, as expected. The second (caused by...
5
by: Samuel R. Neff | last post by:
When you have an unhandled exception in vb.net how do you view the exception information in the debugger? In C# the debugger creates a local variable that points to the exception and you can...
0
by: Colmeister | last post by:
I recently read Jason Clark's excellent article on Unhandled Exceptions (http://msdn.microsoft.com/msdnmag/issues/04/06/NET/default.aspx) and have attempted to incorporate the features he talks...
5
by: Simon Tamman {Uchiha Jax} | last post by:
Now this is bugging me. I just released software for a client and they have reported an unhandled stack overflow exception. My first concern is that the entirity of the UI and any threaded...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.