|
This should be very straightforward, try
string debug = Properties.Settings.Default.Debug;
Alan.
|
|
|
|
|
Thank you very much, that worked like a champ!!
Glenn
|
|
|
|
|
Hello All,
I'm working on a program which needs to partition (i.e. fdisk) and format the filesystems on a USB flash drive.
I've been looking for methods in the .NET namespace which would implement those functions, but I'm not finding them.
So, does .NET provide methods for partitioning and formatting hard disks?
Should I be wrapping the fdisk.exe and format.exe command line tools?
Is there another (better) method I should be looking at?
Thanks,
Ron Aldrich
Software Architects, Inc.
|
|
|
|
|
Ron Aldrich wrote: I've been looking for methods in the .NET namespace which would implement those functions, but I'm not finding them.
You did not search enough .
See here[^].
|
|
|
|
|
Should I be wrapping the fdisk.exe and format.exe command line tools?
Is there another (better) method I should be looking at?
There is no alternative method in .Net Frame work ,
you have to invoke fdisk.exe/format.exe from your application using
System.Disgonisics.Process.
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
I want to get Default Windows Forms Unhandled-Exception Dialog whenever my C# application encounters U-E.
In vs 2005 when I turn off jit Debugging in app.conf like this:
<configuration>
<system.windows.forms jitDebugging="false" />
<configuration>
the application behaves correctly and shows Windows Forms U-E default dialog, with Continue, Quit, call stack and all.
However in vs 2008, on the same machine or different, even though I diable jit I still get Default .NET Unhandled-Exception Dialog, with Debug, Send Report and Don't Send buttons.
How can I make my vs 2008 app act like the one I make in vs 2005, to show Windows Forms U-E dialog box?
Any help is appreciated
-- Modified Tuesday, April 13, 2010 1:02 AM
|
|
|
|
|
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
|
|
|
|