How to retrieve the installed ASP.NET version

It happens many times that you don’t have access to an ASP.NET server, except for FTP, and you’re interested in finding out the version of .NET Framework or ASP.NET that runs on that server.
To find out what version of ASP.NET you have installed and running on a server, using ASP.NET itself, you can use the System.Environment.Version – the easiest way is to create a version.aspx file containing the following lines:

<%@ Page Language="VB" %>
<% Response.Write(System.Environment.Version) %>

If you access it using your browser, this should output something such as 1.1.xxxx or 2.0.xxxx which is the version currently running: ASP.NET 1.1 or ASP.NET 2.0. This code works the same way in C# as it does in VB.NET, by simply changing the Language attribute to C#.

If you receive an error, it’s most likely because the server administrator disabled the access to the System.Environment namespace. In that case you can still find the version by looking at the bottom of the error page, where you will notice the ASP.NET version being displayed.

You should be aware that System.Environment.Version gives you the version of ASP.NET that’s set to run for the current web application. Other web applications on the server could be set to use a different version of ASP.NET.

Nathan Pakovskie is an esteemed senior developer and educator in the tech community, best known for his contributions to Geekpedia.com. With a passion for coding and a knack for simplifying complex tech concepts, Nathan has authored several popular tutorials on C# programming, ranging from basic operations to advanced coding techniques. His articles, often characterized by clarity and precision, serve as invaluable resources for both novice and experienced programmers. Beyond his technical expertise, Nathan is an advocate for continuous learning and enjoys exploring emerging technologies in AI and software development. When he’s not coding or writing, Nathan engages in mentoring upcoming developers, emphasizing the importance of both technical skills and creative problem-solving in the ever-evolving world of technology. Specialties: C# Programming, Technical Writing, Software Development, AI Technologies, Educational Outreach

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top