plugins in winform application
<p>I have a function for loading all the dll in the repository</p>

<pre><code>namespace MFDBAnalyser

{

    public class PluginManager
    {

        /// &lt;summary&gt;
        /// This function gets the name of the plugins and return that in a datatable dt.
        /// &lt;/summary&gt;
        /// &lt;param name="args"&gt;&lt;/param&gt;
        /// &lt;returns&gt;&lt;/returns&gt;
        static void Main(string[] args)

        {

            List&lt;string&gt; assemblyNames = new List&lt;string&gt;();
            Assembly[] oAssemblies = new Assembly[args.Length];

            for(int assemblyCount = 0;assemblyCount &lt; args.Length;assemblyCount++)
            {
                oAssemblies[assemblyCount] = Assembly.LoadFile(args[assemblyCount]);

                try
                {
                    foreach(Type oType in oAssemblies[assemblyCount].GetTypes())
                    {
                        // Check whether class is inheriting from IMFServicePlugin.
                        if(oType.GetInterface("IMFDBAnalyserPlugin") == typeof(IMFDBAnalyserPlugin))
                        {
                            assemblyNames.Add(args[assemblyCount].Substring(args[assemblyCount].LastIndexOf("\\") + 1));
                        }
                    }
                }
                catch(Exception ex)
                {
                    EventLog log = new EventLog("Application");
                    log.Source = "MFPluggerService";
                    log.WriteEntry(ex.Message);
                }
            }

            // Passing data one application domain to another.
            AppDomain.CurrentDomain.SetData("AssemblyNames", assemblyNames.ToArray());
        }

    }
}
</code></pre>

<p>And an another interface class like this</p>

<pre><code>public interface IMFDBAnalyserPlugin
{

    string RunAnalysis(string ConnectionString);

}
</code></pre>

<p>What I need is to return the string that I wrote in the RunAnalysis method</p>

<pre><code>public class PrimaryKeyChecker : IMFDBAnalyserPlugin
{

    public string RunAnalysis(string ConnectionString)

    {
        return "Hello Srivastav!";
    }
}
</code></pre>

<p>But It has a Program.cs class as the main entry point for the application.</p>

<pre><code>    static class Program
    {

    /// &lt;summary&gt;
    /// The main entry point for the application.
    /// &lt;/summary&gt;

    [STAThread]

    static void Main()

        {

        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Application.Run(new MFDBAnalyser());

        }
    }
}
</code></pre>

<p>So it is showing the error that no two main can be there in one application.
I need to get the methods fire from the pliginmanager.cs</p>

<p>I am very confused...Can u guys please have a look at my problem</p>
