Introduction
In this article we will learn how to determine the public key token of a DLL that we add as a reference to our project. I hope you will like it.
Background
Today I was trying to determine a public key of a DLL that I added to my MVC project. I learned that we can determine this by using our Visual Studio itself. Here I am sharing that information and will use Visual Studio 2012.
Using the code
To determine the DLL information, you need to run your project, since this process will work only in debug mode. You need to put a breakpoint somewhere in your cs page.
And when the break hits, you need to go to the immediate window by pressing Alt+Ctrl+I.
Now a window will open, there you need to type the following:
- ?System.Reflection.Assembly.LoadFile(@"C:\SVenu\TestApp\TestApp\bin\CellSetGrid2.dll").FullName
Then you can see the output in the immediate window as follows:

If you are not in debug mode or you are in design mode, you will get a warning as follows.
“The expression cannot be evaluated while in design mode.”

You can always check the entire details of the DLL by giving the following command.
- ?System.Reflection.Assembly.LoadFile(@"C:\SVenu\TestApp\TestApp\bin\CellSetGrid2.dll")
Then you can see the output in the immediate window as follows.

Please note that the output given here will be different depending on your DLL.
Conclusion
That is all. I hope you liked this article. Please share me your feedback.


Santhakumar MunuswamyPosted Jul 16, 2015, 11:53 AM EDT
Nice Article! Thanks for sharing
Sibeesh VenuTOP 100Posted Jul 16, 2015, 9:15 AM EDT
Narasimha Reddy Chennupalli thank you
Narasimha Reddy ChennupalliPosted Jul 16, 2015, 4:50 AM EDT
Nice one..
Sibeesh VenuTOP 100Posted Jul 15, 2015, 8:41 PM EDT
Sathish Kumar Yes. We can find out using SN.exe also
Sibeesh VenuTOP 100Posted Jul 15, 2015, 8:40 PM EDT
Gopi Chand Thank you
Sathish KumarPosted Jul 15, 2015, 5:28 PM EDT
Hi sibeesh, thanks for sharing us. I hope using the SN.exe also able to find out the public key token.
Gopi ChandPosted Jul 15, 2015, 8:39 AM EDT
Nice
Sibeesh VenuTOP 100Posted Jul 15, 2015, 4:42 AM EDT
Rakesh Chavda Thank you
Sibeesh VenuTOP 100Posted Jul 15, 2015, 4:42 AM EDT
Nilesh Jadav Thank you
RakeshPosted Jul 15, 2015, 3:50 AM EDT
Good one
Nilesh JadavPosted Jul 15, 2015, 2:45 AM EDT
Nice one sir !