Link to home
Start Free TrialLog in
Avatar of crickpaolo
crickpaolo

asked on

Get the PublicKeyToken of an assembly

I have an ASP.NET web application that uses a bunch of assemblies.  They are all declared under the <assemblies> tag on web.config. I have a couple of questions regarding this:

1. How do I get the PublickKeyToken for a particular .dll?
2. If the assembly is declared in the web.config, does that always mean that it is located on the GAC?

Many thanks.
Avatar of CJ_S
CJ_S
Flag of Netherlands image

Not sure what you are trying to accomplsih.

Have you checked the following method?

System.AppDomain.CurrentDomain.GetAssemblies()

Avatar of crickpaolo
crickpaolo

ASKER

Here's my situation:

I inherited an ASP.NET application (written in 2005) that uses several assemblies. One of the assemblies, for example, is declared on web.config as:

<add assembly="eWorld.UI, Version=1.9.0.0, Culture=neutral, PublicKeyToken=24X65337282035F2"/>

I didn't know what this assembly was, so I googled it, and it turned out to be a third party dll for creating calendar popups. I downloaded the assembly, but I can only download the latest version which is Version 2.0.0.0.

I changed the Version parameter on web.config, but I think I have to change the PublicKeyToken also, since it is a new version.

Thanks.
                  
Try the following commandline:

1) sn -T eWorld.dll
2) No - not necessarily
I tried it on on the command line and I get this error:

'sn' is not recognized as an internal or external command,operable proggram or batch file.

do i need to go to a particular directory to run this command?
ASKER CERTIFIED SOLUTION
Avatar of CJ_S
CJ_S
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If needed you should add quotes around the location of sn.
It worked! Thanks!