Solved

# How do I find my DLL's PublicKeyToken if the project / assembly was not strongly named?

Posted on 2011-09-12
552 Views
I'm having trouble with finding the PublicKeyToken of my project, created in VS 2010 ASP .NET 3.5 (C#). I've run some tools to find the publickeytoken but now i find out that the project / assembly was not strongly named. i didn't know i was goin to need to strongly name it. is there a way to strongly name it or is there a way to find the publickeytoken for it. It is causing my web.config to fail / error out.
0
Question by:mikesExpertExchange
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2

LVL 75

Accepted Solution

käµfm³d   👽 earned 500 total points
ID: 36523506
If the assembly is not strongly named, then there is no public key token! You can create a new key file to sign the assembly. This won't be a key file in the sense of one attained from the likes of Verisign, et. al., but it will allow you to strongly name the file. You'll find the option to create a key file on the "Signing" tab of your project's properties:

Once you check the box, you can click the dropdown and there will be an option for "<New...>". If you select this, a new dialog will open which allows you to name the key file. You can optionally specify a password for that file as well:

Once you click "OK", your assembly should be strongly named at that point. You can use the Strong Name utility "sn.exe" to inspect the value of the public key token. Open a VS Command Prompt and enter the following command:

sn.exe -T C:\path\to\your\compiled.dll


The PKT should print to the console window.
untitled2.PNG
0

LVL 1

Author Closing Comment

ID: 36524332
thank you
0

LVL 75

Expert Comment

ID: 36524441
NP. Glad to help  = )
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

### Suggested Solutions

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
###### Suggested Courses
Course of the Month3 days, left to enroll