Wer ein Windows Service von C# nach VB.Net konvertiert, möchte vielleicht eine Übersetzungshilfe verwenden wie von Developerfusion.
C# Code in die Textbox kopieren, “Konvertieren” drücken, und den VB-Code ins Projekt übernehmen.

Es gibt mehrere Dinge, auf die man aufpassen muß; Und auf eines möchte hier eingehen: das Kommando ‘STOP’.

In der C# Welt beendet der Befehl “Stop” das Windows Service. Aber in VB.Net wird der Debugger lediglich gebeten, an diesem Punkt eine Pause einzulegen. Das ergibt eine Fehlermeldung, aber ganz sicher kein Ende.

Abhilfe schafft hier der Umstieg auf ‘Me.Stop()‘.

+–+–+–+–+–+–+–+

When porting a Windows Service from C# to VB.Net you might use a translation tool like Developerfusion.
It’s just to simple: copy the C# code into the Textbox, press ‘Convert’ button and receive the VB.Net code.

Having a couple of things to be carefull with, there’s one I’d like to mention here: the command ‘STOP’

When using ‘Stop’ in C#, you force Termination of the Windows Service, while in VB.NET you just tell the Debugger to stop at that point.

Save yourself some painfull memories by using ‘Me.Stop()‘.