[C#] Application working when started from GUI but not when started as service via /r/learnprogramming


[C#] Application working when started from GUI but not when started as service

Hey guys

I need some help with a little C# Programm i wrote. It's a C# application that reads data out of a SQL-Server DB, then formats it a little and writes it back into a Oracle g11 DB. I put the main methodes and classes into a .dll-file. This dll is used by a simple GUI and a windows service. The GUI works without a problem. When I start the programm, it connects to both DBs and then checks for updates on the SQL-Server. Everything works exacly like it should. After that I installed the service onto my testing-mashine (Win 7 x64) and after some tweaking the service runs. But when I install the service onto our Server (Win 2012 Std) I can start it – the windows eventlogging tells me it started – but after about 4-5 seconds it crashes when it tries to call the start-methode of my dll. The windows-event logging show that "Windows Error Reporting" reportet the following:

Fehlerbucket , Typ 0 Ereignisname: CLR20r3 Antwort: Nicht verfügbar CAB-Datei-ID: 0 Problemsignatur: P1: sp_cti2erp_service.exe P2: 1.0.0.0 P3: 596defba P4: mscorlib P5: 2.0.0.0 P6: 4fee6afb P7: 123a P8: 5f P9: System.IO.FileNotFoundException P10: Angefügte Dateien: C:\Windows\ServiceProfiles\LocalService\AppData\Local\Temp\WER42DC.tmp.WERInternalMetadata.xml C:\Windows\ServiceProfiles\LocalService\AppData\Local\Temp\WER42DD.tmp.hdmp C:\Windows\ServiceProfiles\LocalService\AppData\Local\Temp\WER515F.tmp.mdmp Diese Dateien befinden sich möglicherweise hier: C:\ProgramData\Microsoft\Windows\WER\ReportQueue\AppCrash_sp_cti2erp_servi_b0e5f145691cf69e42e06afe19eac234b8d4ad8_cab_117b51ba Analysesymbol: Es wird erneut nach einer Lösung gesucht: 0 Berichts-ID: 69a2ac89-6bab-11e7-944b-005056000703 Berichtstatus: 4 Bucket mit Hash: 

This is the last statements that are executet befor it crashes:

this._pullService = new CoreService(); this._pullService.LogMan.LogEvent += new LogEventHandler(this.OnLogEvent); _pullServiceThread = new Thread(new ThreadStart(_pullService.Start)); _pullServiceThread.Start(); 

I am very sorry but I cant upload the complete code because the Project is fucking huge. I am also sorry if this is the wrong place to post. First time posting here.

Any way thanks for any help and have a nice day 🙂

Submitted July 18, 2017 at 07:46AM by _N0x
via reddit http://ift.tt/2uyCctW

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s