Sep 21, 2015

Posted in , , , ,

Visual Studio Hosting Tips - How to Find PublicKeyToken of a DLL?

In this post, we will learn about how to find PublicKeyToken of a DLL that we add as a reference to our project. Today i used to be trying to see a public key of a DLL that I added to my MVC project. I learned that we can verify this by using our Visual Studio itself. Here i'm sharing that info 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 correct mode. you wish to place a breakpoint somewhere in your cs page.

And once the break hits, you wish to go to the immediate window by pressing Alt+Ctrl+I.
Now a window can open, there you need to write 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:
“The expression cannot be evaluated while in design mode.”

You can always check the entire details of the DLL by giving the following code:
?System.Reflection.Assembly.LoadFile(@"C:\SVenu\TestApp\TestApp\bin\CellSetGrid2.dll")
Then you can see the output:
Please note that the output given here will be different depending on your DLL.
 
HostForLIFE.eu Visual Studio Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments. 
 
Visual Studio Hosting Tips - How to  Find PublicKeyToken of a DLL?

0 comments:

Post a Comment

thanks for your comment!