RationalGeek
RationalGeek

Reputation: 9599

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?

Upvotes: 6

Views: 254

Answers (2)

Filip Navara
Filip Navara

Reputation: 4828

How about printing System.Environment.Version?

Upvotes: 7

Related Questions