I have a web server that is run by a third party. I don't have direct access to the server but I can deploy ASP.NET code to it. I want to detect if that server is running ASP.NET 4 / .NET 4 or not. What is the easiest way to do that? Is there an environmental property somewhere that would tell me? Or should I try to load a particular class that only exists in .NET 4?
Look in c:\windows\Microsoft.NET\Framework and you will see various folders starting with "v" indicating the versions of .NET installed. Show activity on this post. This will bring up all the trace information and you will find your ASP.NET version in the "Response Headers Collection" under "X-ASPNet-Version".
This is server side technique to detect page load in asp.net application. If we write something in Page_Load () event of C# code behind then it will execute at time of page load. We discussed four techniques to detect page load in asp.net application.
Find .NET Framework versions 4.5 and later in the registry From the Start menu, choose Run, enter regedit, and then select OK. In the Registry Editor, open the following subkey: HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv4Full. Check for a DWORD entry named Release.
In the Registry Editor, open the following subkey: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full. If the Full subkey isn't present, then you don't have the .NET Framework 4.5 or later installed. The NET Framework Setup folder in the registry does not begin with a period.
How about printing System.Environment.Version?
http://msdn.microsoft.com/en-us/library/system.environment.version.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With