Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect .NET 4 from ASP.NET?

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?

like image 489
RationalGeek Avatar asked Sep 20 '10 13:09

RationalGeek


People also ask

How do I find out what version of ASP NET I have?

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".

How to detect page load in ASP NET application?

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.

How do I find out what version of Windows 7 NET Framework?

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.

How do I know if I don't have the NET Framework?

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.


2 Answers

How about printing System.Environment.Version?

like image 183
Filip Navara Avatar answered Oct 06 '22 10:10

Filip Navara


http://msdn.microsoft.com/en-us/library/system.environment.version.aspx

like image 27
thr Avatar answered Oct 06 '22 11:10

thr