Typ oder namespace-name konnte nicht gefunden werden

Arbeite ich an einer desktop-Anwendung, die ich brauche, um die assembly zu laden und führen Sie es in verschiedenen appdomain.

Für das laden der assembly, die ich geschrieben habe als:

public static DataTable GetAllPluginNames(string[] args)
{
        SqlConnection sConnection = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);

        //ToDo: create a table of one column - only name of the plugin and return that.
        //ToDo: refer the code from MFAssemblyValidator from MFPluggerService.

        DataTable dt = null;
        List<string> assemblyNames = new List<string>();
        Assembly[] oAssemblies = new Assembly[args.Length];

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

            try
            {
                foreach (Type oType in oAssemblies[assemblyCount].GetTypes())
                {
                    //Check whether class is inheriting from IMFDBAnalyserPlugin.
                    if (oType.GetInterface("IMFDBAnalyserPlugin") == typeof(IMFDBAnalyserPlugin))
                    {
                        assemblyNames.Add(args[assemblyCount].Substring(args[assemblyCount].LastIndexOf("\\") + 1));
                    }
                }
                 return dt;
            }
            catch (Exception ex) 
            {
                lblError.Text = "ERROR";
            }


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

aber typeof(IMFDBAnalyserPlugin)) zeigt eine namespace-Fehler.

IMFDBAnalyserPlugin ist die interface-Klasse in meinem Programm so:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MFDBAnalyser
{
    public interface IMFDBAnalyserPlugin
    {
        void ExecutePlugin();
    }
}

Was das problem sein könnte??
Kann jemand mir helfen!!

InformationsquelleAutor Srivastava | 2010-11-20
Schreibe einen Kommentar