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?

>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 );
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.