Salut a tous !!!!

J'ai fait une petite application C#, afin de tester une implémentation simple, de mapreduce, pour tester sa en réseau j'utilise .net remoting pour le moment.

Seulement voila j'ai un petit soucie de sérialisation.

L'application me lance l'erreur



J'ai marqué les classes comme étant sérialisable pourtant l'erreur persiste.

La fonction que j'appel est :


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
       public IEnumerable<KeyValuePair<TOK, TOV>> Run<TIK, TIV, TTK, TTV, TOK, TOV>(IMapReduces.Map<TIK, TIV, TTK, TTV> map, IMapReduces.Reduce<TTK, TTV, TOK, TOV> reduce, IEnumerable<KeyValuePair<TIK, TIV>> input)
        {
            //
            // Map and group all at once
            //
            Dictionary<TTK, List<TTV>> tempStorage = new Dictionary<TTK, List<TTV>>();
 
            foreach (KeyValuePair<TIK, TIV> inputPair in input)
            {
                foreach (KeyValuePair<TTK, TTV> tempPair in map(inputPair.Key, inputPair.Value))
                {
                    List<TTV> vals = new List<TTV>();
                    if (!tempStorage.TryGetValue(tempPair.Key, out vals))
                    {
                        vals = new List<TTV>();
                        tempStorage.Add(tempPair.Key, vals);
                    }
                    vals.Add(tempPair.Value);
                }
            }
 
 
            //
            // Reduce
            //
            foreach (KeyValuePair<TTK, List<TTV>> tempPair in tempStorage)
            {
                foreach (KeyValuePair<TOK, TOV> outPair in reduce(tempPair.Key, tempPair.Value))
                {
                    yield return outPair;
                }
            }
        }

Dans mon client la class Program est :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
 
    class Program
    {
        private static IMapReduces.IMapReduce remoteOperation;
        private static string epath = @"F:\Visual Studio 2008\Projects\BlueCurve Desktop Search\Lucene\Lucene.Net\Index";
 
        private static IEnumerable<KeyValuePair<string, int>> WordCountMap(string docId, string doc)
        {
            char[] splitChars = { ' ', '\r', '\n', '\t', '\x0085' };
            foreach (string word in doc.Split(splitChars, StringSplitOptions.RemoveEmptyEntries))
            {
                yield return new KeyValuePair<string, int>(word, 1);
            }
        }
 
        private static IEnumerable<KeyValuePair<string, int>> WordCountReduce(string word, IEnumerable<int> counts)
        {
            int wordCount = 0;
            foreach (int count in counts)
            {
                wordCount += count;
            }
            yield return new KeyValuePair<string, int>(word, wordCount);
        }
 
        private static IEnumerable<KeyValuePair<string, string>> AllFilesInDirectory(string path, string searchPattern)
        {
            foreach (string fileName in Directory.GetFiles(path, searchPattern))
            {
                yield return new KeyValuePair<string, string>(fileName, File.ReadAllText(fileName));
            }
        }
 
        static void Main()
        {
            try
            {
                TcpChannel channel = new TcpChannel();
                ChannelServices.RegisterChannel(channel,true);
                remoteOperation = (IMapReduces.IMapReduce)Activator.GetObject(
                    typeof(IMapReduces.IMapReduce),
                    "tcp://192.168.1.5:1069/RemoteOperation");
 
                if (remoteOperation != null)
                {
                    foreach (
                        KeyValuePair<string, int> wordAndCount in remoteOperation.Run<string, string, string, int, string, int>(
                          WordCountMap, WordCountReduce, AllFilesInDirectory(epath, "*.cs")))
                    {
                         Console.WriteLine("{0}: {1}", wordAndCount.Value, wordAndCount.Key);
                    }
                }
 
 
            }
            catch (Exception e) {
                Console.WriteLine(e);
            }
            Console.ReadLine();
        }
    }
J'ai testé plusieurs solutions mais aucune de fonctionne ou c'est moi qui n'est pas capté un truc .

merci de votre aide !!!!