How to get properly formatted fully qualified assembly name

Sometimes you need the full assembly name, properly formatted to use for various reasons
(such as a WCF Custom Behavior file that is imported into BizTalk adapter).

Here are a couple of ways to get it:

DOS Comamnd Window (GacUtil /L)


C:\Windows\system32>gacutil /l | find "bLogical"
  bLogical.BizTalk.RESTBehavior, Version=1.0.0.0, Culture=neutral, PublicKeyToke
n=8b7f8ad23140b57b, processorArchitecture=MSIL
  bLogical.RESTSchemas, Version=1.0.0.0, Culture=neutral, PublicKeyToken=fef5a20
096b53fc0, processorArchitecture=MSIL

C# using reflection


//using System.Reflection  -- add this using statement 
Assembly assembly = Assembly.LoadFrom(@"d:\GitAtlasCore\RestErrorHandling\bLogical.BizTalk.RESTBehavior\bin\Debug\bLogical.BizTalk.RESTBehavior.dll");
foreach (Type type in assembly.GetTypes())
  {
    Console.WriteLine(type.FullName);
    //Console.WriteLine(type.AssemblyQualifiedName);
  }

Console.WriteLine("-----"); 
Type myType = assembly.GetType("bLogical.BizTalk.RESTBehavior.BizTalkRESTRequestHandlerExtensionElement");
Console.WriteLine(myType.AssemblyQualifiedName); 

Console.ReadLine(); 

Output of C#


bLogical.BizTalk.RESTBehavior.BizTalkRESTResponseHandler
bLogical.BizTalk.RESTBehavior.RequestContext
bLogical.BizTalk.RESTBehavior.BizTalkRESTRequestHandlerExtensionElement
bLogical.BizTalk.RESTBehavior.BizTalkRESTRequestHandlerBehavior
bLogical.BizTalk.RESTBehavior.BizTalkRESTRequestHandler
bLogical.BizTalk.RESTBehavior.BizTalkRESTTransmitHandlerExtensionElement
bLogical.BizTalk.RESTBehavior.BizTalkRESTTransmitHandlerEndpointBehavior
bLogical.BizTalk.RESTBehavior.BizTalkRESTTransmitHandler
bLogical.BizTalk.RESTBehavior.BizTalkRESTTransmitErrorHandler
bLogical.BizTalk.RESTBehavior.CustomJsonErrorBodyWriter
bLogical.BizTalk.RESTBehavior.MessageHelper
-----
bLogical.BizTalk.RESTBehavior.BizTalkRESTRequestHandlerExtensionElement, bLogica
l.BizTalk.RESTBehavior, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8b7f8ad
23140b57b

Uncategorized  

Leave a Reply