G
Guest
I am writing a web app to be widely distributed where I do not know the
installed .NET Framework version. I want to take advantage of some .NET 3.0
classes if they are installed, but gracefully degrade if not available.
(Specifically, I want to use System.Windows.Media.Imaging.BitmapMetadata to
extract metadata from JPEG files when 3.0 is available, but will resort to
System.Drawing.Image if .NET 3.0 is not installed.)
What is the recommended best practice for determining whether .NET 3.0 is
installed? The solution must work in a Medium Trust environment. I am not
sure if there is a framework class for querying this info or if I should just
try accessing the class and let the exception tell me it is not available.
I have found that System.Environment.Version.ToString() gives 2.0.50727.1378
on my PC, so that doesn't help. (Unless the "1378" indicates that 3.0 is
installed, but I doubt it.)
Thanks!
Roger Martin
installed .NET Framework version. I want to take advantage of some .NET 3.0
classes if they are installed, but gracefully degrade if not available.
(Specifically, I want to use System.Windows.Media.Imaging.BitmapMetadata to
extract metadata from JPEG files when 3.0 is available, but will resort to
System.Drawing.Image if .NET 3.0 is not installed.)
What is the recommended best practice for determining whether .NET 3.0 is
installed? The solution must work in a Medium Trust environment. I am not
sure if there is a framework class for querying this info or if I should just
try accessing the class and let the exception tell me it is not available.
I have found that System.Environment.Version.ToString() gives 2.0.50727.1378
on my PC, so that doesn't help. (Unless the "1378" indicates that 3.0 is
installed, but I doubt it.)
Thanks!
Roger Martin