you can try this ....
Assembly.GetAssembly assumes that you have an instance of the type, and Type.GetType assumes that you have a fully qualified type name that includes the assembly name.
You can specify the path where the assembly is located.
If you only have a base type name, you need to do something more like this:
public static String GetAssemblyNameContainingType(String typeName) { foreach (Assembly currentassembly in AppDomain.CurrentDomain.GetAssemblies()) { Type t = currentassembly.GetType(typeName, false, true); if (t != null) {return currentassembly.FullName;} } return "not found"; }
It also assumes your type is declared at the root. You will need to provide a namespace or enclosing types in the name or repeat it in the same way.
rockyashkumar
source share