none
No public installers error when installing windows service

    Question

  • I am new to Windows Services and have created a windows service in vb 2005 that adds new contacts from an access database.  Everything compiles and works just fine.  When I try to load the service using installutil I get the following error.  
    No public installers with the RunInstallerAttribute.Yes attribute could be found in the C:\VanguardContacts\VanguardContacts\bin\Debug\vanguardcontacts.vshost.exe assembly.
    Remove InstallState file because there are no installers.
    I have done some research and see that it is because my installer is not public.  Here is my code for the ProjectInstaller.Designer.vb

    <System.ComponentModel.RunInstaller(

    True)> Partial Class ProjectInstaller

     

    Inherits System.Configuration.Install.Installer

     

    'Installer overrides dispose to clean up the component list.

    <System.Diagnostics.DebuggerNonUserCode()> _

     

    Protected Overrides Sub Dispose(ByVal disposing As Boolean)

     

    Try

     

    If disposing AndAlso components IsNot Nothing Then

    components.Dispose()

     

    End If

     

    Finally

     

    MyBase.Dispose(disposing)

     

    End Try

     

    End Sub


    When I change this to public I get an error when I try to compile.  The error I get upon changing my installer to public is on the projectinstaller.vb class at the line Public Class ProjectInstaller below.

    Imports

     

    System.ComponentModel

    Imports

     

    System.Configuration.Install

    Public

     

    Class ProjectInstaller

     

    Public Sub New()

     

    MyBase.New()

     

    'This call is required by the Component Designer.

    InitializeComponent()

     

    'Add initialization code after the call to InitializeComponent

     

    End Sub

    End

     

    Class

    The error I get on that line is this:
    Error 1 class 'ProjectInstaller' and class 'ProjectInstaller', declared in 'C:\Documents and Settings\Visual Studio 2005\Projects\Contacts\ProjectInstaller.Designer.vb', conflict in namespace 'Contacts'. C:\Documents and Settings\Visual Studio 2005\Projects\Contacts\ProjectInstaller.vb 4 14 Contacts


     
    Monday, October 12, 2009 8:46 PM

Answers

  • Hi,
    From the error message at the end of your question, we need to give full namespace modifier before type 'ProjectInstaller ', because the name of this type is conflict with another type under namespace 'Contacts '.

    Thanks,
    Eric
    Please remember to mark helpful replies as answers and unmark them if they provide no help.
    • Marked as answer by eryang Thursday, October 22, 2009 2:36 AM
    Tuesday, October 20, 2009 2:48 AM
  • You perhaps need to check the designer file doesn't have a different, explicit scope modifer before it's class defintion. You have ProjectInstaller.vb and ProjectInstaller.Designer.vb files... make sure they both say public infront of the class, or one says public and the other doesn't say public/private/friend etc. at all.
    • Marked as answer by eryang Thursday, October 22, 2009 2:36 AM
    Tuesday, October 20, 2009 2:59 AM

All replies

  • Hi,
    From the error message at the end of your question, we need to give full namespace modifier before type 'ProjectInstaller ', because the name of this type is conflict with another type under namespace 'Contacts '.

    Thanks,
    Eric
    Please remember to mark helpful replies as answers and unmark them if they provide no help.
    • Marked as answer by eryang Thursday, October 22, 2009 2:36 AM
    Tuesday, October 20, 2009 2:48 AM
  • You perhaps need to check the designer file doesn't have a different, explicit scope modifer before it's class defintion. You have ProjectInstaller.vb and ProjectInstaller.Designer.vb files... make sure they both say public infront of the class, or one says public and the other doesn't say public/private/friend etc. at all.
    • Marked as answer by eryang Thursday, October 22, 2009 2:36 AM
    Tuesday, October 20, 2009 2:59 AM