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

  • Home
  • SEARCH
  • 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

The problem is this: I have multiple competing threads (100+) that need to access
I need to use something like get_or_create() but the problem is that I have
In my code I need to compare string letters but my problem is that
I need to familiarize myself with this technology. My problem is that Google is
Ok i know this is quite off-topic for programmers but still I need this
I've got two objects that need to point to one another... the only problem
I have this big problem that i dont know how to fix. I have
A problem that we need to solve regularly at my workplace is how to
I have an interesting SQL problem that I need help with. Here is the
Problem There are data gaps that need to be filled. Would like to avoid

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.