Note that there are some explanatory texts on larger screens.

plurals
  1. PODifferent behavior between Desktop App and Service App
    text
    copied!<p>I´m having the weirdest problem.</p> <p>In my C# solution, I have a desktop test application, and a service application. On the start of both applications, I call the exact same methods, and the behaviour is completely different. My desktop application is working just fine, reads a COM port, process that info, and then inserts that data on my DB. The service application, read the COM port fine, but then the processing of the data is completely different, and after that it throws an SQLException because it is trying to convert wrong data(Specifficaly a datetime '01/01/0001')</p> <p>I need this application to be a Service, I´m having the desktop app just to test it. I´ve been working on services for a while and I´ve never seen this behavior before.</p> <p>How is it possible that the application and the service work so different calling the same functions using the EXACT same libraries?.</p> <p>Here is the code:</p> <ul> <li><p>Service:</p> <pre><code>protected override void OnStart() { csGPS.startGPSData(); Thread hiloEscuchar = new Thread(delegate() { csListener listener = new csListener(); listener.listenAutoCommand(); }); hiloEscuchar.Start(); Thread hiloEnviar = new Thread(delegate() { csSender.buscarComandos(); }); hiloEnviar.Start(); Thread hiloEnviarPosiciones = new Thread(delegate() { csSender.enviarPosiciones(); }); hiloEnviarPosiciones.Start(); } </code></pre></li> <li><p>Desktop App:</p> <pre><code>private void btnComenzar_Click(object sender, EventArgs e) { csGPS.startGPSData(); Thread hiloEscuchar = new Thread(delegate() { csListener listener = new csListener(); listener.listenAutoCommand(); }); hiloEscuchar.Start(); Thread hiloEnviar = new Thread(delegate() { csSender.buscarComandos(); }); hiloEnviar.Start(); Thread hiloEnviarPosiciones = new Thread(delegate() { csSender.enviarPosiciones(); }); hiloEnviarPosiciones.Start(); lblEstado.Text = "STARTED"; btnComenzar.Enabled = false; } </code></pre></li> </ul> <p>I hope you guys can help me.</p> <p>Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload