I'm fairly new in VB.NET coding, so I'm afraid I've missed something fundamental. The following is my issue:
I tried to use SharpDevelop v2.1.0 to create a VB.NET Windows service, since I have .NET 2.0 as well as 1.1/1.0 on my machine. To begin with, I selected a "New Solution" as VBNet Windows Service. Then, I tried to build it without any modification at all, expecting the service to do nothing. The build failed with three errors as below:
Line 1: 'Sub Main' was not found in 'me'. (BC30420)
Line 12: Keyword is not valid as an identifier. (BC30183) - C:\Documents and Settings\leyang\My Documents\SharpDevelop Projects\me\me.vb:12
Line 25: 'MyServiceName' is not a member of 'me.ProjectInstaller'. (BC30456) - C:\Documents and Settings\leyang\My Documents\SharpDevelop Projects\me\ProjectInstaller.vb:25
What's the problem here?
(BTW, the third error was in ProjectInstaller.vb as shown in underline below
<code>
Public Class
ProjectInstaller
Inherits Installer
Private serviceProcessInstaller As New ServiceProcessInstaller
Private serviceInstaller As New ServiceInstaller
Public Sub New()
' Here you can set properties on serviceProcessInstaller or register event handlers
serviceProcessInstaller.Account = ServiceAccount.LocalService
serviceInstaller.ServiceName =
Me.MyServiceName
Me.Installers.AddRange(New Installer() { serviceProcessInstaller, serviceInstaller })
End Sub
End Class
</code>
After I changed this line to
serviceInstaller.ServiceName = me.serviceInstaller.ServiceName
This error would disappear.)
Thnaks very much.