Get .Net version number in c#

117
Views
1
Answers

How do I get what is the .Net version number my app is currently running on using c#?

edit | flag
Mad Maddy
Asked on: Feb 02, 2012 at 12:18AM

1 Answers

117
4
117

You can try this code

Assembly asbly = Assembly.Load("App_Code");
AssemblyName assemblyname = asbly.GetName();

string Version = assemblyname.Version.ToString();

or

if its a website project use

 Assembly asbly = Assembly.GetExecutingAssembly();
AssemblyName assemblyname = asbly.GetName();
string Version = assemblyname.Version.ToString();

and dont forget to add the namespace

using System.Reflection;

in your page

edit | flag
Gokul A
Answered on: Feb 02, 2012 at 12:26AM

Post your Answer

Search

Welcome to Ask Amoeba!
This is 100% free and interactive site for sharing professional Questions and Answers, Opensource projects, Interview questions.
Learners, beginners, Experts stop and share your knowledge and ideas!

Browse Categories

Browse Tags