473,379 Members | 1,317 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,379 software developers and data experts.

Missing .NET and Exceptions

Hi All,

I've been reading about Application.ThreadException,
Application.SetUnhandledExceptionMode &
AppDomain,CurrentDomain.UnhandledException. I'm trying to determine if there
is a mechanism where if the .NET framework is missing, is there any way at
all to gracefully catch it in my code and inform the user of what's wrong.
Is this even possible? If so, how can I catch it and nicely inform the user
of the problem - Microsoft's "The application failed to initialize
properly..." message is basically useless to a user. If it's even possible &
anyone has any code to share, I'd be much appreciative.

TIA,

--
John C. Bowman
Software Engineer II
Thermo Fisher Scientific
<Remove this before replyjo*********@thermofisher.com
WORLDWIDE CONFIDENTIALITY NOTE: Dissemination, distribution or copying of
this e-mail or the information herein by anyone other than the intended
recipient, or an employee or agent of a system responsible for delivering
the message to the intended recipient, is prohibited. If you are not the
intended recipient, please inform the sender and delete all copies.
Jun 25 '07 #1
2 1359
John,

It's impossible, since the code you would write is managed code, and
without the framework installed, managed code won't run.

You would have to create an unmanaged stub to check for the existence of
the framework, and then show the appropriate message if it is not installed.
If it is, then you would just create a new process and run your managed
executable then.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"John Bowman jo*********@thermo.com>" <<Remove this before replywrote in
message news:et**************@TK2MSFTNGP03.phx.gbl...
Hi All,

I've been reading about Application.ThreadException,
Application.SetUnhandledExceptionMode &
AppDomain,CurrentDomain.UnhandledException. I'm trying to determine if
there is a mechanism where if the .NET framework is missing, is there any
way at all to gracefully catch it in my code and inform the user of what's
wrong. Is this even possible? If so, how can I catch it and nicely inform
the user of the problem - Microsoft's "The application failed to
initialize properly..." message is basically useless to a user. If it's
even possible & anyone has any code to share, I'd be much appreciative.

TIA,

--
John C. Bowman
Software Engineer II
Thermo Fisher Scientific
<Remove this before replyjo*********@thermofisher.com
WORLDWIDE CONFIDENTIALITY NOTE: Dissemination, distribution or copying of
this e-mail or the information herein by anyone other than the intended
recipient, or an employee or agent of a system responsible for delivering
the message to the intended recipient, is prohibited. If you are not the
intended recipient, please inform the sender and delete all copies.

Jun 25 '07 #2
Hi,

Not, unfortunatelly all those events, classes, etc that you mention, well
they are part of the framework in tehr first place :)

You would have to create an unmanaged process to detect the presence of the
framework.

Or convince MS to create another message :D

"John Bowman jo*********@thermo.com>" <<Remove this before replywrote in
message news:et**************@TK2MSFTNGP03.phx.gbl...
Hi All,

I've been reading about Application.ThreadException,
Application.SetUnhandledExceptionMode &
AppDomain,CurrentDomain.UnhandledException. I'm trying to determine if
there is a mechanism where if the .NET framework is missing, is there any
way at all to gracefully catch it in my code and inform the user of what's
wrong. Is this even possible? If so, how can I catch it and nicely inform
the user of the problem - Microsoft's "The application failed to
initialize properly..." message is basically useless to a user. If it's
even possible & anyone has any code to share, I'd be much appreciative.

TIA,

--
John C. Bowman
Software Engineer II
Thermo Fisher Scientific
<Remove this before replyjo*********@thermofisher.com
WORLDWIDE CONFIDENTIALITY NOTE: Dissemination, distribution or copying of
this e-mail or the information herein by anyone other than the intended
recipient, or an employee or agent of a system responsible for delivering
the message to the intended recipient, is prohibited. If you are not the
intended recipient, please inform the sender and delete all copies.

Jun 25 '07 #3

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

Similar topics

0
by: Dan Bishop | last post by:
I installed Python on the HP 3000 at work today. The interpreter itself appears to be working fine, but "import math", "import datetime", etc. fail with "ImportError: No module named ". ...
0
by: Grady Nash | last post by:
All of my web servers are running win2000 and .NET 1.1 SP1. On one of my test web servers when I open Perfmon and add a new counter, aspnet_wp is missing. For example I want to see how many...
11
by: vijaynats | last post by:
Why isn't there a 'throws' keyword in C# like java - i would like to declare a function and say - public int addup(int a, int b) throws ArithmeticExceptio, DivideByZeroException { ... ... }
11
by: BoloBaby | last post by:
OK, check this out... I have a form with a panel control and button on it (outside the panel control). I have two event handlers - one handles the click event of the button on the form. The...
42
by: redefined.horizons | last post by:
I'm coming from a Java background, so please don't stone me... I see that Python is missing "interfaces". The concept of an interface is a key to good programming design in Java, but I've read...
1
by: Anonieko | last post by:
Understanding and Using Exceptions (this is a really long post...only read it if you (a) don't know what try/catch is OR (b) actually write catch(Exception ex) or catch{ }) The first thing I...
2
by: Jacob Rael | last post by:
Hello, I was following along with this site: http://www.brunningonline.net/simon/blog/archives/000659.html and I got a error. It boils down to: ====================
20
by: mc | last post by:
I may be opening a can of worms and don't want to start a religious war, but... What features of Java do Java programmers miss when working in C#? Other than, of course, great portability. C#...
1
by: =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?= | last post by:
Well -- I generally use the web-base Microsoft newsgroup app, and all I see is the text of your message. I don't remember ever seeing a "handled" property of the exception dialog, at least not in...
17
by: Christoph Zwerschke | last post by:
I'm just reading PEP 3107 (function annotations) and wonder why exceptions are not mentioned there. I think it would be helpful if one could specify which exceptions can be raised by a function,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...

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.