Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Determine the Installed ASP.NET Version of Host from a Web Page

Tags:

.net

asp.net

I have a site running in a Windows shared hosting environment. In their control panel for the shared hosting account I have it set to use ASP.NET version 3.0 but it doesn't say 3.5 SP1 specifically.

How can I view the installed version running on the server where my website is hosted in an asp.net page?

like image 497
Brian Boatright Avatar asked Sep 01 '08 05:09

Brian Boatright


3 Answers

Thanks!

I just dropped <%=Environment.Version%> on a page and got 2.0.50727.3053

like image 116
Brian Boatright Avatar answered Nov 10 '22 22:11

Brian Boatright


@Jon Limjap: Unfortunately, this tells you the .NET CLR (runtime library) version, not the version of the .NET Framework. These two version numbers are not always the same; in particular, the .NET Framework 3.0 and 3.5 both use the .NET CLR 2.0. So the OP may indeed have only .NET 2.0 SP1, as the Environment.Version indicates, or he may also have the .NET 3.5 SP1 which he is looking for.

like image 20
Michael Ratanapintha Avatar answered Nov 10 '22 21:11

Michael Ratanapintha


One way is to throw an exception in Page Load, but don't catch it. At the bottom of the page, you'll see the version number.

like image 30
Daniel Jennings Avatar answered Nov 10 '22 22:11

Daniel Jennings