|
How about maybe handling the exceptions in the first place.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi Mark,
Thanks for your prompt reply. I know what you mean and yes I handle all I can, however I want to know why Windows Forms U-E dialog box is not showing up in 2008, since we are not ideal and still there could be unhandled exception in the big projects. This will also help to make them handled.
Thanks
|
|
|
|
|
souren77 wrote: I handle all I can
That should be 100% then.
You can capture unhandled exceptions. AppDomain.UnhandledException Event[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark, I don't do any custom UnhandledException processing in the code neither for vs 2005 project nor for vs 2008 project. It's same simple application just to find out the mistery. However, the last one does not show Windows Forms Unhandled-Exception Dialog.
In other words, I know I can capture myself Unhandled Exceptions, but I want to engage .NET default capture mechanism for windows form unhandled exceptions.
Thanks
|
|
|
|
|
souren77 wrote: I want to engage .NET default capture mechanism for windows form unhandled exceptions.
Why?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
One of the reasons I like the default message box formatting, look and feel.
Why would I design this:
http://i26.tinypic.com/23i8adw.jpg
if it's a part of CLR, at least when I'm using vs 2005 to build an app and all I need is to figure out why it's not being called. I've googled a lot really past 2 days for it. I know I could have write my handler, but I need to get to the bottom really, it drives me crazy.
|
|
|
|
|
Such dialog provides technical information only. It does not help your customer, as it does not reflect which action of his went wrong, nor does it help him in remedying. And it does not help the developer once the app is in the field, as it does not log anything. So IMO that kind of dialog is to be avoided, except maybe, just maybe, during the early development phase. You really should catch exceptions and either deal with them, or show the user something he can understand and work with; and log it.
|
|
|
|
|
In my experience it helped a lot exactly in the field. So the user can pass me some information instead of telling that application is crashed. And to gather dump I have to do something on my own.
Stack trace information is very useful.
catching exception, logging and understanding is good in more mature stages of application. Like you said on early stages sometimes you need something quick.
|
|
|
|
|
souren77 wrote: good in more mature stages of application.
souren77 wrote: the user can pass me some information instead of telling that application is crashed.
These two statements don't correlate. At more matures stages an application is not shipped to customers with unhandled exceptions. What app do you ship? I'd like to avoid them.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote: How about maybe handling the exceptions in the first place.
Some of the built-in classes throw exceptions in their own threads (serialPort seems to be nasty for this). How should one trap such an exception?
|
|
|
|
|
the SerialPort events run on a ThreadPool thread; what would keep you from having an overall try-catch in their event handler?
|
|
|
|
|
Luc Pattyn wrote: the SerialPort events run on a ThreadPool thread; what would keep you from having an overall try-catch in their event handler?
How would one go about doing that? If I get a threadpool thread (e.g. using Delegate.BeginInvoke) and enter a Try-Catch, the pool won't be returned to the threadpool (and thus be available to SerialPort) until after the Try-Catch block has existed. How would one wrap the SerialPort's handlers in a try/catch block? If I try to read data from a SerialPort object which has opened a USB-to-serial converter, and the USB cable gets unplugged, I get an unhandled exception in an alien thread (often SafeHandle was Disposed, but various factors may cause different ones).
|
|
|
|
|
No, you put the try-catch in the handler, not the other way around.
void serial_DataReceiver(...) {
try {
...
} catch(Exception exc) {
log(exc.ToString());
...
}
}
|
|
|
|
|
It doesn't matter how many threads you have in your application, they are all hosted in the same AppDomain
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
You might want to go through this article.
|
|
|
|
|
Hi,
Thanks for the article, however, it describes how to implement _custom_ unhandled exception class.
What I want to get is _default_ handler, just like I get it in vs 2005 project.
Any other ideas?
|
|
|
|
|
Try running DevEnv /resetsettings from your command prompt (at your own risk).
This will reset all your VS 2008 settings.
|
|
|
|
|
Nop, didn't help. Still no default windows form unhandled exception dialog...
|
|
|
|
|
Hi,
I have craeted one dll.some body cracked that dll.whether ASP.NET provide any alert message or any information to that owner of dll
|
|
|
|
|
your question is not clear..,
if That DLL is developed by you.., YOU R THE OWNER
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
Edit the post to make your question clear. It is very hard to understand what you are asking.
|
|
|
|
|
Your question isn't entirely clear.
But, if you're asking if there is any way to have a .NET DLL "phone home" and tell you that someone cracked it, no. Since .NET .DLL can be easily decompiled using Reflector, and your .DLL code is not running at the time, your code will never know that someone looked at it using Reflector.
|
|
|
|
|
well, if cracked means modified - making an assembly strong-named provides a guarantee that the assembly have not been changed since it was built.
Gabriel Szabo
|
|
|
|
|
Hi All,
I've got the following code, which runs an exe with some switches and then sends the log file to me, or at least it's supposed to.
I receive the email ok, but no attachment.. the code compiles fine..
has anyone any ideas??
<br />
MyProcess.StartInfo.FileName = "printmig.exe"<br />
MyProcess.StartInfo.WorkingDirectory = "c:\print backup"<br />
MyProcess.StartInfo.Arguments = "printmig.exe /b /i"<br />
MyProcess.Start()<br />
<br />
MyProcess.WaitForExit()<br />
<br />
<br />
Dim objMail As New System.Net.Mail.MailMessage()<br />
Dim obj As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient<br />
Dim Mailmsg As New System.Net.Mail.MailMessage<br />
Mailmsg.To.Clear()<br />
Mailmsg.To.Add(New System.Net.Mail.MailAddress("receivers address"))<br />
Mailmsg.From = New System.Net.Mail.MailAddress("senders address")<br />
Mailmsg.Subject = "(subject text)"<br />
<br />
Dim attachment As New System.Net.Mail.Attachment("C:\file.log") 'create the attachment<br />
objMail.Attachments.Add(attachment) 'add the attachment<br />
<br />
<br />
Try<br />
Mailmsg.Body = ""<br />
obj.Host = "external smtp server" ' Modify to YOUR smtp server<br />
obj.Send(Mailmsg)<br />
Catch ex As Exception<br />
Write("Error: " & ex.ToString())<br />
<br />
Cheers
nhsal69
|
|
|
|
|
You are adding the attachment to objMail
objMail.Attachments.Add(attachment)
but you are sending Mailmsg
obj.Send(Mailmsg)
I know the language. I've read a book. - _Madmatt
|
|
|
|