|
-
January 27th, 2008, 01:28 PM
#1
Catching ".NET framework not found" exception? How do I do it?
Hey people,
I was just wondering if my .NET based application could detect the presence of the 2.0 Framework on the computer it is running from before actually loading the main form and all (i.e. from the main entry point Main()). I am developing a let's-say-semi-professional-project and without the framework installed on the machine, a rather strange and not so informative message from Microsoft comes up which is rather vague (can't remember the exact words). Is there any way I could catch this exception?
Thanks.
-
January 27th, 2008, 01:32 PM
#2
Re: Catching ".NET framework not found" exception? How do I do it?
Best bet is to do it with a small peice of native c++ code. If you atempt to do it from manaed code your options are REALLY limited (since the framework is not installed/available).
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions 
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
-
January 27th, 2008, 02:07 PM
#3
Re: Catching ".NET framework not found" exception? How do I do it?
-
January 27th, 2008, 05:27 PM
#4
Re: Catching ".NET framework not found" exception? How do I do it?
 Originally Posted by dglienna
Thanks, it's pretty much what I need but wouldn't I still have to use C++ unmanaged code to perform this check? I already have the framework installed so it's difficult to try it out.
-
January 27th, 2008, 05:39 PM
#5
Re: Catching ".NET framework not found" exception? How do I do it?
Or scripting. Whatever you are comfortable in, except .Net
-
January 27th, 2008, 08:23 PM
#6
Re: Catching ".NET framework not found" exception? How do I do it?
I found out about the Visual Studio 2005 Bootstrapper which can deploy your application after checking if all prerequisites have been installed on the target machine.
This is a very satisfactory solution to my problem but hey.. has anybody used this thing? I've just deployed my application and it's generated the setup.exe file and all but... the installer does not ask you WHERE to install, it just installs into a defualt directory that couldn't be worse (C:\Documents and Settings\blah blah blah). ****...
Am I blind not being able to see the obvious or is Microsoft just too plain stupid?
-
January 28th, 2008, 04:39 PM
#7
Re: Catching ".NET framework not found" exception? How do I do it?
Ahh, never mind! I used the NSIS installer to deploy my application. Much simpler and effective. The VS2005 Deployment thing was for morons anyway...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|