.NET Framework Version
-
How do I detect, at runtime, what the .NET Framework Version is? Jamie Nordmeyer Portland, Oregon, USA
-
How do I detect, at runtime, what the .NET Framework Version is? Jamie Nordmeyer Portland, Oregon, USA
-
How do I detect, at runtime, what the .NET Framework Version is? Jamie Nordmeyer Portland, Oregon, USA
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 -
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 GrausHey, 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
-
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
why are you trying to muck around with the asp.net script files?
-
why are you trying to muck around with the asp.net script files?
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
-
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
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.