Nikahat Khan

Nikahat Khan

  • NA
  • 5
  • 4.4k

Get Vs version number

Nov 30 2011 5:20 AM
i want to get the Visual studio version number using envdte on the build event .
I tried to get it through this code.../
Process[] p = Process.GetProcessesByName("devenv");
foreach (Process proc in p)
{
if (proc.ProcessName == "devenv")
{
MessageBox.Show(proc .MainModule .FileVersionInfo.FileVersion);

}
}

but the problem is for 2 different version of VS it shows both versions as 2 instances of devenv are opened in the Tsakmanager.
please provide solution asap.

Answers (1)