Bonjour,
Je viens vous exposer mon problème. Pour mon projet de fin d'année je dois réaliser une IHM avec un Client/serveur afin de me connecter à un "WiFiBot".
Mon IHM est réalisée avec Windows Forms sur Visual Studio Community 2013 ; mon client est pour le moment une simple application console réalisée elle aussi avec VS Community 2013.
Le client arrive à se connecter parfaitement au serveur.

Maintenant, je dois l'inclure à l'IHM. Et c'est là que ça pose problème !
Je me retrouve avec cette erreur : "Une exception non gérée s'est produite dans votre application. Si vous cliquez sur Continuer, l'application va ignorer cette erreur et essayer de continuer. Si vous cliquez de Quitter, l'application va s'arrêter immédiatement.

Echec de l'initialisation du système de configuration."

Et dans le détail :
Consultez la fin de ce message pour plus de détails sur l'appel du débogage
juste-à-temps (JIT) à la place de cette boîte de dialogue.

************** Texte de l'exception **************
System.Configuration.ConfigurationErrorsException: Échec de l'initialisation du système de configuration ---> System.Configuration.ConfigurationErrorsException: Section de configuration non reconnue ApplicationsMetaData. (D:\Documents\Jaures\2016_Projet_Wifibot\wifibot1.1.1\wifibot1.0\bin\Debug\wifibot1.0.exe.Config line 6)
à System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
à System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
à System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()
à System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
--- Fin de la trace de la pile d'exception interne ---
à System.Configuration.ConfigurationManager.PrepareConfigSystem()
à System.Configuration.ConfigurationManager.GetSection(String sectionName)
à System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
à System.Diagnostics.DiagnosticsConfiguration.Initialize()
à System.Diagnostics.DiagnosticsConfiguration.get_Sources()
à System.Diagnostics.TraceSource.Initialize()
à System.Net.Logging.InitializeLogging()
à System.Net.Logging.get_On()
à System.Net.Sockets.TcpClient..ctor(AddressFamily family)
à System.Net.Sockets.TcpClient..ctor()
à wifibot1._0.Client..ctor() dans D:\Documents\Jaures\2016_Projet_Wifibot\wifibot1.1.1\wifibot1.0\Client.cs:ligne 17
à wifibot1._0.Form1.connexion_Click(Object sender, EventArgs e) dans D:\Documents\Jaures\2016_Projet_Wifibot\wifibot1.1.1\wifibot1.0\Form1.cs:ligne 59
à System.Windows.Forms.Control.OnClick(EventArgs e)
à System.Windows.Forms.Button.OnClick(EventArgs e)
à System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
à System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
à System.Windows.Forms.Control.WndProc(Message& m)
à System.Windows.Forms.ButtonBase.WndProc(Message& m)
à System.Windows.Forms.Button.WndProc(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Assemblys chargés **************
mscorlib
Version de l'assembly*: 4.0.0.0
Version Win32*: 4.6.1073.0 built by: NETFXREL3STAGE
CodeBase*: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
wifibot1.0
Version de l'assembly*: 1.0.0.0
Version Win32*: 1.0.0.0
CodeBase*: file:///D:/Documents/Jaures/2016_Projet_Wifibot/wifibot1.1.1/wifibot1.0/bin/Debug/wifibot1.0.exe
----------------------------------------
System.Windows.Forms
Version de l'assembly*: 4.0.0.0
Version Win32*: 4.6.1038.0 built by: NETFXREL2
CodeBase*: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Version de l'assembly*: 4.0.0.0
Version Win32*: 4.6.1038.0 built by: NETFXREL2
CodeBase*: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Version de l'assembly*: 4.0.0.0
Version Win32*: 4.6.1068.2 built by: NETFXREL3STAGE
CodeBase*: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
WebKitBrowser
Version de l'assembly*: 0.5.0.0
Version Win32*: 0.5.0.0
CodeBase*: file:///D:/Documents/Jaures/2016_Projet_Wifibot/wifibot1.1.1/wifibot1.0/bin/Debug/WebKitBrowser.DLL
----------------------------------------
System.Configuration
Version de l'assembly*: 4.0.0.0
Version Win32*: 4.6.1038.0 built by: NETFXREL2
CodeBase*: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
Version de l'assembly*: 4.0.0.0
Version Win32*: 4.6.1038.0 built by: NETFXREL2
CodeBase*: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
Version de l'assembly*: 4.0.0.0
Version Win32*: 4.6.1064.2 built by: NETFXREL3STAGE
CodeBase*: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Configuration.resources
Version de l'assembly*: 4.0.0.0
Version Win32*: 4.6.1038.0 built by: NETFXREL2
CodeBase*: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration.resources/v4.0_4.0.0.0_fr_b03f5f7f11d50a3a/System.Configuration.resources.dll
----------------------------------------
WebKit.Interop
Version de l'assembly*: 533.0.0.0
Version Win32*:
CodeBase*: file:///D:/Documents/Jaures/2016_Projet_Wifibot/wifibot1.1.1/wifibot1.0/bin/Debug/WebKit.Interop.DLL
----------------------------------------
wifibot1.0.resources
Version de l'assembly*: 1.0.0.0
Version Win32*: 1.0.0.0
CodeBase*: file:///D:/Documents/Jaures/2016_Projet_Wifibot/wifibot1.1.1/wifibot1.0/bin/Debug/fr/wifibot1.0.resources.DLL
----------------------------------------
mscorlib.resources
Version de l'assembly*: 4.0.0.0
Version Win32*: 4.6.1038.0 built by: NETFXREL2
CodeBase*: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_fr_b77a5c561934e089/mscorlib.resources.dll
----------------------------------------
System.resources
Version de l'assembly*: 4.0.0.0
Version Win32*: 4.6.1038.0 built by: NETFXREL2
CodeBase*: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.resources/v4.0_4.0.0.0_fr_b77a5c561934e089/System.resources.dll
----------------------------------------
System.Windows.Forms.resources
Version de l'assembly*: 4.0.0.0
Version Win32*: 4.6.1038.0 built by: NETFXREL2
CodeBase*: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_fr_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------

************** Débogage JIT **************
Pour activer le débogage juste-à-temps (JIT), le fichier de configuration pour cette
application ou cet ordinateur (machine.config) doit avoir la valeur
jitDebugging définie dans la section system.windows.forms.
L'application doit également être compilée avec le débogage
activé.

Par exemple*:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

Lorsque le débogage juste-à-temps est activé, les exceptions non gérées
seront envoyées au débogueur JIT inscrit sur l'ordinateur
plutôt que d'être gérées par cette boîte de dialogue.
Bien évidemment j'ai cherché cette erreur sur internet... Ce qui me donne une multitude de réponses, pour la plupart hors sujet.
Avez-vous une idée ? :/

Voici le code de mon client, de mon IHM et mon App.config :
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
62
63
64
65
66
67
68
69
70
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Sockets;
using System.Net;
using System.Threading;
using System.IO;
using System.Windows.Forms;
 
 
namespace wifibot1._0
{
    class Client
    {
        TcpClient tcplnt = new TcpClient();
        private int i;
 
        public Client()
        {
            i = 0;
        }
 
        public void connexion()
        {
            Console.WriteLine("Connecting...");
            try
            {
                tcplnt.Connect("192.168.1.106", 15020);
                Console.WriteLine("Connected");
            }
 
            catch (Exception e)
            {
                Console.WriteLine("Error... " + e.StackTrace);
            }
        }
 
        private void Loop()
        {
            if (i == 0)
            {
                while (Thread.CurrentThread.IsAlive)
                {
                    //Thread.Sleep(500);
                    String str = Console.ReadLine();
                    Stream stm = tcplnt.GetStream();
                    ASCIIEncoding asen = new ASCIIEncoding();
                    byte[] ba = asen.GetBytes(str);
                    Console.WriteLine("Transmitting...");
 
                    stm.Write(ba, 0, ba.Length);
                    tcplnt.Client.Shutdown(SocketShutdown.Send);
                }
            }
        }
 
        public void deconnexion()
        {
            Console.WriteLine("Vous allez être déconnecté.");
            //tcplnt.Client.Shutdown(SocketShutdown.Send);
            tcplnt.Close();
        }
 
        ~Client(){
 
        }
    }
}
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WebKit;
using System.IO;
using System.Net;
using System.Net.Sockets;
 
namespace wifibot1._0
{
    public partial class Form1 : Form
    {
        Client client;
        TextWriter _writer = null;
 
        public Form1()
        {
            InitializeComponent();
            this.Load += new EventHandler(Form1_Load);
            this.webKitBrowserMaps.Navigated +=
                new WebBrowserNavigatedEventHandler(webKitBrowserMaps_Navigated);
            this.webKitBrowserCamera.Navigated +=
                new WebBrowserNavigatedEventHandler(webKitBrowserCamera_Navigated);
        }
 
        private void enAvant_Click(object sender, EventArgs e)
        {
            Console.WriteLine("Avant ↑ !");
        }
 
        private void enArriere_Click(object sender, EventArgs e)
        {
            Console.WriteLine("Arrière ↓ !");
        }
 
        private void aGauche_Click(object sender, EventArgs e)
        {
            Console.WriteLine("Gauche ← !");
        }
 
        private void aDroite_Click(object sender, EventArgs e)
        {
            Console.WriteLine("Droite → !");
        }
 
        private void stopButton_Click(object sender, EventArgs e)
        {
            Console.WriteLine("STOP !");
        }
 
        private void connexion_Click(object sender, EventArgs e)
        {
            client = new Client();
            client.connexion();
        }
 
        private void deconnexion_Click(object sender, EventArgs e)
        {
            Console.WriteLine("Deconnexion du WiFiBot... A bientôt !");
            client = new Client();
            client.deconnexion();
        }
 
        private void joystick_Click(object sender, EventArgs e)
        {
            Console.WriteLine("Joystick activé !");
        }
 
        private void openFileGPS_FileOk(object sender, CancelEventArgs e)
        {
 
        }
 
        private void openGPSFile_Click(object sender, EventArgs e)
        {
            DialogResult result = openFileGPS.ShowDialog();
            if(result==DialogResult.OK){
            }
            Console.WriteLine(result);
        }
 
        private void gobutton_Click(object sender, EventArgs e)
        {
            webKitBrowserMaps.Navigate(URLbarre.Text);
        }
 
        void Form1_Load(object sender, EventArgs e)
        {
            _writer = new ConsoleRedirection(txtConsole);
            Console.SetOut(_writer);
        }
 
        void webKitBrowserMaps_Navigated(object sender,
            WebBrowserNavigatedEventArgs e)
        {
            URLbarre.Text = webKitBrowserMaps.Url.ToString();
        }
 
        private void afficheCamera_Click(object sender, EventArgs e)
        {
            webKitBrowserCamera.Navigate(URLCamera.Text);
        }
 
        private void webKitBrowserCamera_Navigated(object sender, EventArgs e)
        {
            URLCamera.Text = webKitBrowserCamera.Url.ToString();
        }
 
        private void webKitBrowserMaps_Load(object sender, EventArgs e)
        {
 
        }
 
        private void webKitBrowserCamera_Load(object sender, EventArgs e)
        {
 
        }
 
        private void txtConsole_TextChanged(object sender, EventArgs e)
        {
 
        }
    }
}
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
  <ApplicationsMetaData>
    <Meta Content="IE=8,9,10,11" Http-Equiv="X-UA-Compatible" />
  </ApplicationsMetaData>
  <system.windows.forms jitDebugging="true" />
</configuration>
Merci d'avance,
Bonne journée