473,385 Members | 2,210 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,385 software developers and data experts.

Console unhaddled event exception not kicking in

GG
I have a console application
[MTAThread]
static void Main(string[] args)
{
//for any unhandled exceptions
AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.UnhandledException += new
UnhandledExceptionEventHandler(HandlerUnhandledExc eption);

next line is
RemotingConfiguration.Configure(filename);

this is the event
public static void HandlerUnhandledException(object sender,
UnhandledExceptionEventArgs args)
{
Exception e = (Exception) args.ExceptionObject;
Console.WriteLine("Error:"+ e.Message.ToString());
Console.WriteLine(e.Source.ToString());
}

This line RemotingConfiguration.Configure(filename);
throws an exception and getting the
Just-In-time Debugging window
It does not go to the HandlerUnhandledException
I even wrapp it in
try
RemotingConfiguration.Configure(filename);
catch
but still get the Just-In-time Debugging Window
How can I use the unhaddled event exception so
I can get rid of Just-In-time Debugging Window?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #1
3 1178
GG wrote:
[snip]
How can I use the unhaddled event exception so
I can get rid of Just-In-time Debugging Window?


You need to add/modify the DWORD value DbgJITDebugLaunchSetting = 1 in the
the following registry key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramewor k

On machines with Visual Studio installed this value is by default set to 2,
what causes the behavior you observed. On machines with just the .NET
framework installed the value does not exist, what causes a slightly
different but I guess equally unwanted behavior...

Regards,

Andreas

Nov 15 '05 #2
GG
You are right
now a get a different msgbox
Server.exe - Common Language Runtime Debugging Services MsgBox
Is there a way to get rid of this one too.

What I am looking for is for the app to throw the msg may be send an
e-mail and then exit gracefully.

Thanks
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #3
GG wrote:
You are right
now a get a different msgbox
Server.exe - Common Language Runtime Debugging Services MsgBox
Is there a way to get rid of this one too.

What I am looking for is for the app to throw the msg may be send an
e-mail and then exit gracefully.


I guess I was unclear, you need to set the value DbgJITDebugLaunchSetting to
1. Then everything should work as you expect.

Regards,

Andreas

Nov 15 '05 #4

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

Similar topics

19
by: Dave | last post by:
Hi, I have done some research, trying to Clear The Screen in java code. The first option was the obv: system.out.print("\n\n\n\n\n\n\n\n\n\n\n\n"); then i heard about this method:...
7
by: Job Lot | last post by:
How can I terminate console application in Try…Catch…Finally…End Try block so that code in Finally gets executed. If I use End statement Finally does not get executed. Following is my code...
2
by: Gulshan Oshan | last post by:
I want to implement a simple console that continuously listens for an event from a custom object. I am unable to capture the events from the object. If I subscribe to the events in a windows app...
5
by: Simon Johnson | last post by:
Recently, a thread appeared which asked how to create a "catch all" method for when an exception occurs within a program. The solution given only works for Windows Forms applications, as far as i...
3
by: Dean Slindee | last post by:
I have a exception handling class that could be called from either a windows project app or a console project app. Is there any way for this class to determine which type of app called it without...
5
by: Nak | last post by:
Hi there, I have a very simple console application that I'm trying to handle the thread exception on, as I understand it there is no Application object available to a console application, so I...
1
by: John Wright | last post by:
I am running a console application that connects to an Access database (8 million rows) and converts it to a text file and then cleans and compacts the database. When it runs I get the following...
0
by: =?Utf-8?B?U3RldmUgTWFydGlu?= | last post by:
I am attempting to launch a console application from a service under a different set of credentials running on Windows Server 2003. I am getting an error "0xC06D007E: Module not found." from the...
0
by: edwardsurjadi | last post by:
guys, i have ASP.NET website(UI) that connect to BusinessLogic(Console Application hosting the BL) through .NET Remoting on different computer. What amussing is, sometimes (very rare), the BL...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.