How to call a Managed DLL File in C#?
问题 I am making a scripting language but I have a serious problem. I need to make it so you can call .NET DLLs in the language but I have found no way to do this in C#. Does any one know how can I load and call a .NET dll programmatically? (I can not just Add reference so don't say that) 回答1: Here's how I did it: Assembly assembly = Assembly.LoadFrom(assemblyName); System.Type type = assembly.GetType(typeName); Object o = Activator.CreateInstance(type); IYourType yourObj = (o as IYourType); where