0
using System;
using System.Reflection;
using System.Diagnostics;
using System.IO;
namespace VersionExe
{
    class Program
    {

        public static void Main(string[] args)
        {
            int i;
            // Get the file version for the notepad.
            FileVersionInfo.GetVersionInfo(Path.Combine(Environment.SystemDirectory, "notepad.exe"));
            FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\\notepad.exe");


            // Print the file name and version number.
            Console.WriteLine("File: " + myFileVersionInfo.FileDescription + '\n' +
               "Version number: " + myFileVersionInfo.FileVersion);

            for (i = 0; i < 10000000000; i++)
            {
            }
        }

    }
}

I want to know version no. of dll file using the above code that i have written. But it s showing an error. How can i get dll file version?

2
Contributors
1
Reply
5
Views
6 Years
Discussion Span
Last Post by __avd
0

>I want to know version no. of dll file using the above code that i have written.

System.Reflection.Assembly[] ar = AppDomain.CurrentDomain.GetAssemblies();

for (int i = 0; i < ar.Length; i++)
{
    Console.WriteLine(ar[i].FullName );
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.