SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Help pls!

Last post 04-18-2007 8:14 PM by gimmely. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-18-2007 6:52 PM

    Help pls!

    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.

     

  • 04-18-2007 7:30 PM In reply to

    Re: Help pls!

    The template works fine for me, it doesn't say Me.MyServiceName but ProjectName.MyServiceName

    Did you name your project "Me"?

    SharpDevelop will put the project name in some places in the code of new projects, and if you named the project "Me", VB will misinterpret it as the "Me" keyword. Please create a new project with a different name.


    Daniel Grunwald
  • 04-18-2007 8:14 PM In reply to

    Re: Help pls!

    That hits the bull's eye!  Thanks very much.

Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.