65.9K
CodeProject is changing. Read more.
Home

Get Assembly full name from Visual Studio (VersionNo, Culture, PublickeyToken)

starIconstarIconstarIconstarIconstarIcon

5.00/5 (2 votes)

Mar 23, 2012

CPOL
viewsIcon

22814

Getting Assembly full name from Visual Studio

Introduction

This tip helped me to save a lot time, while I was trying to find an assemblies full name. 

Background 

I was learning Unity 2.1. This IOC Container can be configured ( the mapping, life time etc) declaratively using application configuration file. I was just doing the same as mentioned in Microsoft Enterprise Library Hands on Lab (Lab 03). In that lab you need to include a configsection for unity configuration, where the assembly full name (ie, assembly name, version, culture, publicKeyToken) was not mentioned properly and as a result I was getting assembly load exception. After searching for at least 2 hrs, I opened up VS 2010 to create a solution for that (by code :)). But, when I saw System.Runtime.Assembly class, I simple but effective idea came into my mind. Why not to use Visual Studios own power rather than creating a new application. So I opened the Immediate Window of Visual Studio and written the following command. 

Using the code 

Open Visual Studio, and then open the Immediate Window (Alt + Ctrl + i) 

?System.Reflection.Assembly.LoadFile(@"C:\Path\Microsoft.Practices.Unity.Configuration.dll").FullName  

And that's what made my life easy.