How to find the Version, Culture and PublicKeyToken of an Assembly (DLL) using PowerShell

In response to a question on my article How to install a DLL to the GAC on Windows Server 2012 using only PowerShell (without having to install SDK or Visual Studio) here’s how you can find the PublicKeyToken for a DLL using only PowerShell.

([system.reflection.assembly]::loadfile("c:\temp\MyDLL.dll")).FullName

The output of this PowerShell statement will provide the Version, Culture and PublicKeyToken as shown below.
MyDLL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=630d986a50055aa6

Advertisements

About Cameron Dwyer

Architect and developer at OnePlace Solutions. Passionate about delivering compelling solutions on the Office 365/SharePoint platform. Addicted to coffee.

Posted on November 1, 2013, in PowerShell, Windows and tagged , , , , . Bookmark the permalink. 6 Comments.

  1. I fell into the trap of thinking that this command tests which version of a DLL is in the GAC. It does NOT, unless you happen to pick the dll in the Windows\assembly folder

    Liked by 1 person

  2. Any idea on how to get the version and token details of DLLs already present on the server, without specifying a particular path of DLL??

    Liked by 1 person

    • What details do you have to identify the DLL or are you looking for a dump of all DLLs? There are usually quite a few DLL’s in the GAC and you also have separate 32 and 64 bit areas of the GAC.

      Like

  1. Pingback: How to install a DLL to the GAC on Windows Server 2012 using only PowerShell (without having to install SDK or Visual Studio) | Cameron Dwyer | SharePoint, Outlook, OnePlaceMail

  2. Pingback: How to install a DLL to the GAC | SharePoint Interests

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: