Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. How to know which .NET framework servicepack version is used ?

How to know which .NET framework servicepack version is used ?

Scheduled Pinned Locked Moved .NET (Core and Framework)
questioncsharpdotnettutorialannouncement
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kaminem
    wrote on last edited by
    #1

    Hi all, Under my machine I have installed .Net framework v1.1, v2.0 and v3.0 How can I know which version is being used by my applications ? Thanks

    L M 2 Replies Last reply
    0
    • K kaminem

      Hi all, Under my machine I have installed .Net framework v1.1, v2.0 and v3.0 How can I know which version is being used by my applications ? Thanks

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, this is only a partial answer to your question:

      string s=Environment.Version.ToString();
      if (s=="1.1.4322.573") s=s+" (= 1.1 without Service Packs)";
      else if(s=="1.1.4322.2032") s=s+" (= 1.1 with SP1)";
      else if(s.StartsWith("1.1.")) s=s+" (= unknown 1.1 flavor)";
      else if(s=="2.0.50727.832") s=s+" (= 2.0 without Service Packs)";
      else if(s=="2.0.50727.1433") s=s+" (= 2.0 with SP1)";
      else if(s.StartsWith("2.0.")) s=s+" (= unknown 2.0 flavor)";
      Console.WriteLine(s);
      

      It lacks information on 1.0, 3.0 and 3.5, and does not answer the question from outside the app. I too would like to know how to programmatically ask an EXE which Framework it needs without launching it. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      this months tips: - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use PRE tags to preserve formatting when showing multi-line code snippets


      1 Reply Last reply
      0
      • K kaminem

        Hi all, Under my machine I have installed .Net framework v1.1, v2.0 and v3.0 How can I know which version is being used by my applications ? Thanks

        M Offline
        M Offline
        Mike Dimmick
        wrote on last edited by
        #3

        The question is complicated by the fact that version 3.0 and 3.5 do not update the JIT compiler nor the base class libraries. Officially, anyway - 3.5 shipped simultaneously with (and requires) 2.0 SP1 which does update the CLR and BCL. To determine the version of the CLR required, you can use the Assembly.ImageRuntimeVersion property, if you load the assembly using reflection. To determine if libraries from 3.0 or 3.5 are required you will need to use GetReferencedAssemblies and inspect the assemblies that are being loaded.


        DoEvents: Generating unexpected recursion since 1991

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups