TypeLoadException n'a pas été gérée en C #

Je suis assez novice en C#, et je rencontre un problème lors du chargement d'une bibliothèque dans mon programme. Im essayant d'exécuter cette exemple dans visual studio, mais j'obtiens une erreur:

TypeLoadException was unhandled. Can't load type SVM.Problem from assembly SVM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.

C'est ce que mon code ressemble à ceci:

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

namespace SVM
{
class Program
{
    static void Main(string[] args)
    {
        //First, read in the training data.
        Problem train = Problem.Read("a1a.train");
        Problem test = Problem.Read("a1a.test");

        //For this example (and indeed, many scenarios), the default
        //parameters will suffice.
        Parameter parameters = new Parameter();
        double C;
        double Gamma;

        //This will do a grid optimization to find the best parameters
        //and store them in C and Gamma, outputting the entire
        //search to params.txt.
        ParameterSelection.Grid(train, parameters, "params.txt", out C, out Gamma);
        parameters.C = C;
        parameters.Gamma = Gamma;

        //Train the model using the optimal parameters.
        Model model = Training.Train(train, parameters);

        //Perform classification on the test data, putting the
        //results in results.txt.
        Prediction.Predict(test, "results.txt", model, false);
    }
}

}

J'ai ajouté le fichier dll comme une référence par l'intermédiaire de l'explorateur de solutions. Ce qui pourrait mal se passer?


J'ai commencé un nouveau projet, a ajouté la dll en tant que référence, couru le projet et maintenant tout fonctionne. Très frustrant de ne pas savoir ce qui s'est passé, mais je soupçonne qu'il avait quelque chose à voir avec le nom du projet et le nom de la dll d'être le même. Merci pour votre aide!

source d'informationauteur Freek8