Solved

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

Posted on 2011-09-12
3
548 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:mikesExpertExchange
  • 2
3 Comments
 
LVL 75

Accepted Solution

by:
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:

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:mikesExpertExchange
ID: 36524332
thank you
0
 
LVL 75

Expert Comment

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

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

813 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now