2012-09-11 2 views
18

Windows 서비스를 설치하려고합니다.installutil이 성공적으로 완료되었지만 서비스가 설치되지 않았습니다.

는 C 실행 : \ WINDOWS를 \ microsoft.net \ Framework64 \ v4.0.30319은 InstallUtil.exe는의 C : \ \ foo는 \ MyAssembly.exe

내가이 성공적으로 완료 모든 단계는 (설치, 커밋) 멋진 메시지가 .

나중에 내가 서비스 콘솔에서 서비스를 볼 수 없습니다 (내가 서비스 자격 증명을 입력하라는 메시지가 표시되지 않습니다). 설치 로그에 유용한 것은 없습니다.

솔루션은 64 비트 상자에 구축되었으며 64 비트 시스템에 서비스를 설치하려고합니다. 그러나 솔루션 속성에서 옵션으로 64 비트가 표시되지 않습니다. 나는 수동으로 [플랫폼] 노드에 대해 "x64"를 선택하기 위해 모든 csproj 파일을 편집했습니다.

나는 Visual Studio에서 서비스를 실행할 수 있습니다.

installer.cs

[RunInstaller(true)] 
public partial class Installer : System.Configuration.Install.Installer 
{ 
    public Installer() { 
     InitializeComponent(); 
    } 
} 

이 비주얼 스튜디오에서 제공하는 기본 설치 프로그램입니다.

+0

제목을 편집했습니다. "[제목에"태그 "가 포함되어 있어야합니까?] (http://meta.stackexchange.com/questions/19190/)"합의가 "아니오, 그렇지 않아야합니다"로 표시되어야합니다. 또한 설치 문제라면 WCF와 관련이 없으므로 태그를 제거했습니다. –

+0

죄송합니다! 단어의 틀린 선택. 설치 스크립트 !! – madhairsilence

+0

madhairsilence .. installer.cs 무엇을 요구 했습니까? –

답변

24

Installers 컬렉션에 일부 Installer 개체를 추가해야합니다. 예 : here은 Windows 서비스를 설치하려는 것입니다. 예를 들어

[RunInstaller(true)] 
public class Installer : System.Configuration.Install.Installer 
{ 
    private ServiceInstaller serviceInstaller; 
    private ServiceProcessInstaller processInstaller; 

    public Installer() 
    { 
     // Instantiate installers for process and services. 
     processInstaller = new ServiceProcessInstaller(); 
     serviceInstaller = new ServiceInstaller(); 

     // The services run under the system account. 
     processInstaller.Account = ServiceAccount.LocalSystem; 

     // The services are started manually. 
     serviceInstaller.StartType = ServiceStartMode.Manual; 

     // ServiceName must equal those on ServiceBase derived classes. 
     serviceInstaller.ServiceName = "Hello-World Service 1"; 

     // Add installers to collection. Order is not important. 
     Installers.Add(serviceInstaller); 
     Installers.Add(processInstaller); 
    } 
} 
관련 문제