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
  1. Home
  2. General Programming
  3. C#
  4. .NET Framework Version

.NET Framework Version

Scheduled Pinned Locked Moved C#
questioncsharpdotnetannouncement
7 Posts 4 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.
  • J Offline
    J Offline
    Jamie Nordmeyer
    wrote on last edited by
    #1

    How do I detect, at runtime, what the .NET Framework Version is? Jamie Nordmeyer Portland, Oregon, USA

    F J 2 Replies Last reply
    0
    • J Jamie Nordmeyer

      How do I detect, at runtime, what the .NET Framework Version is? Jamie Nordmeyer Portland, Oregon, USA

      F Offline
      F Offline
      Feng Qin
      wrote on last edited by
      #2

      :)System.Version I'm amumu, and you?

      1 Reply Last reply
      0
      • J Jamie Nordmeyer

        How do I detect, at runtime, what the .NET Framework Version is? Jamie Nordmeyer Portland, Oregon, USA

        J Offline
        J Offline
        James T Johnson
        wrote on last edited by
        #3

        System.Version is a class that represents a version number; by itself it doesn't tell you the version number of the framework but System.Environment.Version will tell you the version of the CLR. James "Java is free - and worth every penny." - Christian Graus

        J 1 Reply Last reply
        0
        • J James T Johnson

          System.Version is a class that represents a version number; by itself it doesn't tell you the version number of the framework but System.Environment.Version will tell you the version of the CLR. James "Java is free - and worth every penny." - Christian Graus

          J Offline
          J Offline
          Jamie Nordmeyer
          wrote on last edited by
          #4

          Hey, thanks for the reply, James. Apparently, though, the .NET Framework Version is not the same as the script directory that ASP.NET uses. What I mean, is that System.Environment.Version returns 1.0.3705.209, but the ASP.NET script files (WebUIValidation.js, etc.) are in a folder called 1_0_3705_272. Ideally, I'd like to be able to get this folder without having to enumerate its siblings, and look for the highest revision number. Jamie Nordmeyer Portland, Oregon, USA

          A 1 Reply Last reply
          0
          • J Jamie Nordmeyer

            Hey, thanks for the reply, James. Apparently, though, the .NET Framework Version is not the same as the script directory that ASP.NET uses. What I mean, is that System.Environment.Version returns 1.0.3705.209, but the ASP.NET script files (WebUIValidation.js, etc.) are in a folder called 1_0_3705_272. Ideally, I'd like to be able to get this folder without having to enumerate its siblings, and look for the highest revision number. Jamie Nordmeyer Portland, Oregon, USA

            A Offline
            A Offline
            Andy Smith
            wrote on last edited by
            #5

            why are you trying to muck around with the asp.net script files?

            J 1 Reply Last reply
            0
            • A Andy Smith

              why are you trying to muck around with the asp.net script files?

              J Offline
              J Offline
              Jamie Nordmeyer
              wrote on last edited by
              #6

              I'm not trying to modify them or anything. I created a custom validator (that implements IValidator, but doesn't derive from BaseValidator), and was hoping I could just use the available script for client side validation, rather than have to rewrite my own. Jamie Nordmeyer Portland, Oregon, USA

              A 1 Reply Last reply
              0
              • J Jamie Nordmeyer

                I'm not trying to modify them or anything. I created a custom validator (that implements IValidator, but doesn't derive from BaseValidator), and was hoping I could just use the available script for client side validation, rather than have to rewrite my own. Jamie Nordmeyer Portland, Oregon, USA

                A Offline
                A Offline
                Andy Smith
                wrote on last edited by
                #7

                BaseValidator gets the path to the script files from the internal static System.Web.UI.Util.GetScriptLocation method, which gets some of its info from the internal System.Web.Util.VersionInfo.SystemWebVersion property. GetScriptLocation looks up the "clientScriptsLocation" setting in the machine.config file. but that string has parameters which are filled in by SystemWebVersion. You might be best off either using reflection to get to the GetScriptLocation method, or querying the .config file for the root path, and then scanning that folder for the highest version.

                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