I need to programatically determine whether .NET 3.5 is installed. I thought it would be easy:
<% Response.Write(Environment.Version.ToString()); %>
Which returns "2.0.50727.1434" so no such luck...
In my research I have that there are some rather obscure registry keys I can look at but I'm not sure if that is the route to go. Does anyone have any suggestions?
Open Start. Search for Command Prompt, right-click the top result, and select the Run as administrator option. Type the following command to determine the version of . NET installed and press Enter: reg query "HKLM\SOFTWARE\Microsoft\Net Framework Setup\NDP" /s To make sure that version 4.
NET Framework 3.5 is not included by default in Windows 10, Windows Server 2016, and later operating systems but you can download and deploy it for application compatibility.
You could try:
static bool HasNet35()
{
try
{
AppDomain.CurrentDomain.Load(
"System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
return true;
}
catch
{
return false;
}
}
@Nick: Good question, I'll try it in a bit.
Kev
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With