Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 228009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:38:46+00:00 2026-05-11T19:38:46+00:00

The problem is that I need to know if it’s version 3.5 SP 1.

  • 0

The problem is that I need to know if it’s version 3.5 SP 1. Environment.Version() only returns 2.0.50727.3053.

I found this solution, but I think it will take much more time than it’s worth, so I’m looking for a simpler one. Is it possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T19:38:46+00:00Added an answer on May 11, 2026 at 7:38 pm

    Something like this should do it. Just grab the value from the registry

    For .NET 1-4:

    Framework is the highest installed version, SP is the service pack for that version.

    RegistryKey installed_versions = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\NET Framework Setup\NDP");
    string[] version_names = installed_versions.GetSubKeyNames();
    //version names start with 'v', eg, 'v3.5' which needs to be trimmed off before conversion
    double Framework = Convert.ToDouble(version_names[version_names.Length - 1].Remove(0, 1), CultureInfo.InvariantCulture);
    int SP = Convert.ToInt32(installed_versions.OpenSubKey(version_names[version_names.Length - 1]).GetValue("SP", 0));
    

    For .NET 4.5+ (from official documentation):

    using System;
    using Microsoft.Win32;
    
    
    ...
    
    
    private static void Get45or451FromRegistry()
    {
        using (RegistryKey ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey("SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full\\")) {
            int releaseKey = Convert.ToInt32(ndpKey.GetValue("Release"));
            if (true) {
                Console.WriteLine("Version: " + CheckFor45DotVersion(releaseKey));
            }
        }
    }
    
    
    ...
    
    
    // Checking the version using >= will enable forward compatibility,  
    // however you should always compile your code on newer versions of 
    // the framework to ensure your app works the same. 
    private static string CheckFor45DotVersion(int releaseKey)
    {
        if (releaseKey >= 528040) {
            return "4.8 or later";
        }
        if (releaseKey >= 461808) {
            return "4.7.2 or later";
        }
        if (releaseKey >= 461308) {
            return "4.7.1 or later";
        }
        if (releaseKey >= 460798) {
            return "4.7 or later";
        }
        if (releaseKey >= 394802) {
            return "4.6.2 or later";
        }
        if (releaseKey >= 394254) {
            return "4.6.1 or later";
        }
        if (releaseKey >= 393295) {
            return "4.6 or later";
        }
        if (releaseKey >= 393273) {
            return "4.6 RC or later";
        }
        if ((releaseKey >= 379893)) {
            return "4.5.2 or later";
        }
        if ((releaseKey >= 378675)) {
            return "4.5.1 or later";
        }
        if ((releaseKey >= 378389)) {
            return "4.5 or later";
        }
        // This line should never execute. A non-null release key should mean 
        // that 4.5 or later is installed. 
        return "No 4.5 or later version detected";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A problem that we need to solve regularly at my workplace is how to
The problem that I am having has to do with the need to keep
I have a problem with reflection. I need to find the type that instantiates
i have very simple problem. I need to create model, that represent element of
One problem that I come across regularly and yet don't have a solution to
This has been a problem that I haven't been able to figure out for
I have the problem that an specific step in Ant can only be executed
He're an interesting problem that looks for the most Pythonic solution. Suppose I have
I have a wierd problem that i need to work out how to resolve,
I have a problem that confuses my users, being that although an item is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.