Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2011-09-12
3
Medium Priority
?
563 Views
Last Modified: 2012-05-12
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
Comment
Question by:Michael Sterling
  • 2
3 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 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:

Signing Tab
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:

Naming the Key File
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

Open in new window


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

Author Closing Comment

by:Michael Sterling
ID: 36524332
thank you
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 36524441
NP. Glad to help  = )
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Integration Management Part 2
Loops Section Overview
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question