To get the Calling Assembly in C# or VB.NET you can use Reflection.

Sample C#

using System.Reflection;

public static string GetCallingAssemblyName()
{
var callingAssembly = Assembly.GetCallingAssembly();
return callingAssembly.FullName;
}

Sample VB.NET

Imports System.Reflection

Public Shared Function GetCallingAssemblyName() As String
    Dim callingAssembly = Assembly.GetCallingAssembly()
    Return callingAssembly.FullName
End Function

for more informations see the MSDN: Reflection (C# and Visual Basic), Assembly.GetCallingAssembly Method

2 thought on “How to get the Calling Assembly in C# or VB.NET”

Leave a Reply