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 6605001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:13:53+00:00 2026-05-25T19:13:53+00:00

I know this question has been answered in other post but it dosent solves

  • 0

I know this question has been answered in other post but it dosent solves my problem:

Senario:

i have developed an application .net framework 3.5 sp1 using WPF

When i run the application by clicking the executable i wish to check if the required .net Version is installed or else give a message to the user….. i tried all solution available on the net….

but if the Run the application on a machine which does not have .net framework or has a framework version lower that 3.5 .. its shows the crash screen
Crash screen

My Code that i am currently using in App.Xaml.cs

//Check the registry entry for .NET Framework.
            RegistryKey frameworkRegistryKey =
                Registry.LocalMachine.OpenSubKey(DOT_NET_FRAMEWORK_KEY_PATH);
            if (frameworkRegistryKey != null)
            {
                //Check for the installed versions.
                string[] versionNames =
                    frameworkRegistryKey.GetSubKeyNames();
                double framework =
                    Convert.ToDouble(
                        versionNames[versionNames.Length - 1].Remove(0, 1));
                int servicePack = Convert.ToInt32(
                    frameworkRegistryKey.OpenSubKey(
                        versionNames[versionNames.Length - 1]).GetValue(
                            SERVICE_PACK, 0));
                //Check if the version is 3.5 Service Pack 1 or later.
                if ((framework < 3.5)
                    || ((framework == 3.5) && (servicePack < 1)))
                {
                    returnCode = ErrorCodesEnum.ERR_DOT_NET_FRAMEWORK;
                }
            }

I also doubt that if its possible as without the right libraries how will my application run

Any help or suggestions will be gr8

  • 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-25T19:13:53+00:00Added an answer on May 25, 2026 at 7:13 pm

    No matter what you do, if minimum required .NET version is not installed on the system you can’t detect it using a program targeting .NET since it won’t run at all! You’ll need to use a bootstrapper with your installer to detect the framework installation and install it as necessary.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this question has been asked and answered in other forums, but I
I know this question has been asked before, but I ran into a problem.
I know this question has been done but I have a slightly different twist
I know this has probably been answered as it seems a common question but
I know this question has been asked many times, but my problem is a
i know this has been answered lots on SO but i still have a
I know this question has been answered before in this thread , but I
I know this question has been asked/answered but I can't find it for the
I know this question has been asked and answered before, but none of the
I know this question has been answered in accordance with RFC 1459 . But

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.