I am making a program that lets users create their own plugins and these plugins consist of a main class that follows an interface.

When i load the 2 dlls the dll loader code calls a "plugin_name" method thats in both plugins and is also defined in the interface. It returns the same value for both dlls, along with calling all other methods that are defined in the interface, even though the second dll has different values.

It loads the first dll correctly but after that is does what it says above.

Heres the code im using to load the dlls:

holder.p.aplugin is a class and holder.p.plugins is an array of that class.

Code:
		string[] listPlugins = Directory.GetFiles("Plugins\\", "*.dll", SearchOption.AllDirectories);
				
	
            	foreach (string plug in listPlugins)
            	{

					Assembly assembly = Assembly.LoadFrom(plug);
					foreach (Type type in assembly.GetTypes())
					{
						if (type.IsClass == true)
						{
							
							if (type.GetInterface("plugin.i") == null)
							{
								continue;
							}
							holder.p.aplugin temp = new holder.p.aplugin();
							
							temp.pluginInterface = Activator.CreateInstance(type);
                		                        object[] arguments = new object[] { };
							
							temp.pluginType = type;
                    		temp.pluginName = (string)type.InvokeMember("plugin_name",
                                                BindingFlags.Default | BindingFlags.InvokeMethod,
                                                null,
                                                temp.pluginInterface,
                                                arguments);
                                //MessageBox.Show(temp.pluginName); //always return same value

                    		temp.pluginAuthor = (string)type.InvokeMember("author",
                                                BindingFlags.Default | BindingFlags.InvokeMethod,
                                                null,
                                                temp.pluginInterface,
                                                arguments);
                    		temp.pluginVersion = (double)type.InvokeMember("version",
                                                BindingFlags.Default | BindingFlags.InvokeMethod,
                                                null,
                                                temp.pluginInterface,
                                                arguments);
                    		temp.pluginDescription = (string)type.InvokeMember("description",
                                                BindingFlags.Default | BindingFlags.InvokeMethod,
                                                null,
                                                temp.pluginInterface,
                                                arguments);
                    		temp.pluginCategory = (string)type.InvokeMember("category",
                                                BindingFlags.Default | BindingFlags.InvokeMethod,
                                                null,
                                                temp.pluginInterface,
                                                arguments);
							
                                              //adds plugin too array here
						}		
					}
					
			}