.NET and C# error messages wishlist

G

Guest

I love the .NET framwework. Compared to mfc this is a dream to work with.

I would love if the C# and maybe other languages too, somehow gives more
friendly messages when executed on a machine with not .NET framework
installed.

* Some unmanaged startup stub in the generated executable would be nice.
Maybe a stub that starts up a web site telling you that this application
cannot be run and that you need to install the .NET framework in order to
run this program. (now I get some strange error about an mscoree not found.
This might scare away a lot of users to ever download a .NET program again)

* And another point for the wishlist, is to make the .NET framework a little
bit user friendly when it encounters an error.
If a dll is incorrect I get a cryptic dialog box with a lot of technical
details, which is nice for the programmer that develops the program but
useless for the user.
Again, a web page could be shown telling you that you do not have enough
security rights browse to a network drive and that you have to give enough
rights to the program.
Maybe with a link to the .NET configuration program.
This would also be nice if some dll is not installed. It could show a web
page telling you that the dll with version xx.xx.xx.is not found and that
needs to be installed first.
This could be some plug-in that hooks itself to the .NET error handling.
 
M

Morten Wennevik

I love the .NET framwework. Compared to mfc this is a dream to work with.

I would love if the C# and maybe other languages too, somehow gives more
friendly messages when executed on a machine with not .NET framework
installed.

* Some unmanaged startup stub in the generated executable would be nice.
Maybe a stub that starts up a web site telling you that this application
cannot be run and that you need to install the .NET framework in order to
run this program. (now I get some strange error about an mscoree not
found.
This might scare away a lot of users to ever download a .NET program
again)

I think that may be a limitation of windows. It's an executable, but
windows doesn't know what to do with it when it can't find the file that do
know.

Personally, I hate programs that start up web pages.
* And another point for the wishlist, is to make the .NET framework a
little
bit user friendly when it encounters an error.
If a dll is incorrect I get a cryptic dialog box with a lot of technical
details, which is nice for the programmer that develops the program but
useless for the user.
Again, a web page could be shown telling you that you do not have enough
security rights browse to a network drive and that you have to give
enough
rights to the program.

Bleh, why web pages? Why not a dialog box. Use try/catch and give a
friendlier error instead of the default one.
Maybe with a link to the .NET configuration program.
This would also be nice if some dll is not installed. It could show a web
page telling you that the dll with version xx.xx.xx.is not found and that
needs to be installed first.
This could be some plug-in that hooks itself to the .NET error handling.

You can do this by yourself with try/catch. And again, why web pages?!
 
G

Guest

I think that may be a limitation of windows. It's an executable, but
windows doesn't know what to do with it when it can't find the file that do
know.
Maybe the next critical update might contain some windows kernal upgrade to
help the transition to .NET?
Personally, I hate programs that start up web pages.
This was just an example.
It might also be a dialog box.
Bleh, why web pages? Why not a dialog box. Use try/catch and give a
friendlier error instead of the default one.
For errors that are typical for your application, you are right.

But for errors that are created because of security rights or missing
dll's... a more user friendly standard error handling might be wishful.
Especially for the people that starts programming in .NET.
And having a try-catch for every function you write is not very productive,
and creates a lot of overhead..

Also, I discovered that a lot of programmers have no clue how to use the
try-catch mechanism the right way.
A lot of them uses this just to stop access-violations. (To hide
programming bugs)

One sollution might be to replace the standard exception handler with a more
user friendly one that can be compiled into the program.
Can this be done in C#? Does that exist? And where can I find this?
 
M

Morten Wennevik

I was thinking more of a global one, wrapping Application.Run().
It could simply report the error message and ignore the debugging info.

What you are seeing is in fact a message made because no exception handler
was found for the exception.

static void Main() {
try
{
Application.Run(new Form1());
}
catch(Exception ex)
{
MessageBox.Show(ex.Message, "Critical Error!");
}
}
 
J

Jochen Kalmbach

Morten said:
I was thinking more of a global one, wrapping Application.Run().
[...]
static void Main() {
try
{
Application.Run(new Form1());
}
catch(Exception ex)
{
MessageBox.Show(ex.Message, "Critical Error!");
}
}

A global one would be:
- Registering an event on
"System.AppDomain.CurrentDomain.UnhandledException"

--
Greetings
Jochen

Do you need a memory-leak finder ?
http://www.codeproject.com/tools/leakfinder.asp
 
G

Guest

I was thinking more of a global one, wrapping Application.Run().
It could simply report the error message and ignore the debugging info.

What you are seeing is in fact a message made because no exception handler
was found for the exception.
Why didn't I think of this? :)
That seems a good idea to try to implement.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top