Detecting if MSBuild/.net 4 is installed from C# code running on 3.5?

Posted by Michael Stum on Stack Overflow See other posts from Stack Overflow or by Michael Stum
Published on 2010-06-16T00:26:12Z Indexed on 2010/06/16 0:32 UTC
Read the original article Hit count: 239

Filed under:

I have an application that is running on .net 3.5 SP1 and that is supposed to check if .net 4 is installed.

Actually, I'm more interested if MSBuild v4 is installed, which would boil down to a simple File.Exists(@"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe");

However, apart from the fragility of the 4.0.30319 Version (and the Windir, but that's easy to solve), I wonder if there is a more appropriate way, like an API?

© Stack Overflow or respective owner

Related posts about .NET