Querying the current assembly for version info

G

Guest

I'm trying to figure out how to query an assembly (in this case an aspx
code-behind DLL) for its current version (major, minor, build, ...), and
basically expose it as a property...

public string Version
{
get
{
string version;
version = ....; // code to extract version info from assembly
return version;
}
}
 
N

Nicholas Paldino [.NET/C# MVP]

Nate,

If you have a reference to the assembly in question, you can call the
GetName method, which will return an AssemblyName instance for that
assembly. From there, you can access the Version property to get the
version details of the assembly.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top