.NET version detection and distribution

One of the things that ought to be simpler and more “front-and-center” is the detection of .NET runtime version, getting runtime environment information and updating the runtime.

Yes, yes, yes- these things can be done right now, so it has not been overlooked (here’s a KB for one method http://support.microsoft.com/default.aspx?scid=kb;en-us;315291, and here’s a blog entry from Rob Villahermosa with another method http://blogs.msdn.com/robvi/archive/2004/02/17/75272.aspx). You could also use WMI to do it, and if I have time I could post some code. Of course, an installer is a great place to check for this. These should be part of the launch conditions. There’s also this little trick that shows how to detect .NET on the client in an ASP.NET app (http://www.httprevealer.com/usage_dotnet.htm).

But, I am persuaded that it ought to be even simpler, especially when dealing with the many, many programs we write that have no installer (remember that XCOPY deployment model?) There should be classes hanging right off of System that give up more environment information (about the runtime specifically) and that could let you conditionally update the runtime. It strikes me that this would make it better for the times when an installer is overkill, but just rolling out the assemblies with no conditions is not enough. I just find looking in the registry or file system for runtime info to be a little clumsy compared to what could be done.

Rock thought for the day: Riding my bicycle to Linkin Park is a good thing. I think my average speed increases in these conditions.

Rock on!

Comments (3)

  1. Should it not also be brain dead to detect if the Office PIAs are installed?


  2. Rev says:

    I wonder why microsoft doesn’t give a little more consideration to the Release Engineering department?

    This kind of information should all be consolidated into a site build around the Windows Installer technology complete with sample custom actions, message boards, and the like.

    As it is folks have to rely on Google-Groups and installsite.org. While Google-Groups is good… it doesn’t provide merge modules and the kind of information you’d want directly from the source.

    May haps MS needs to go ahead and hire me and I’ll take care of it. *nods*

    rev_fry at hotmai|.com

  3. Joku says:

    Yes have to nod on this one, it’s not nice to get some odd dll missing or whatever when trying to run the .NET app on a computer with not .NET either. Instead when i run it on comp with no .NET it should check if internet is connected and say "This needs net framework, do you want to install?".