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.
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).
Re: Catching ".NET framework not found" exception? How do I do it?
Re: Catching ".NET framework not found" exception? How do I do it?
Quote:
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.
Re: Catching ".NET framework not found" exception? How do I do it?
Or scripting. Whatever you are comfortable in, except .Net :)
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?
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... :wave: