I have WCF service which i can build and test(install from CMD Installutill) from WCF client successfully. Now i created a wix installer project to create a exe for the same WCF service. Following is the WIX code i have used:
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="TestWCFService">
<Component Id="TestWCFService.exe" Guid="F071A592-33A9-44DA-A81B-AD4AC8195757">
<File Id="TestWCFService.exe" Source="$(var.TestWCFService.TargetDir)TestWCFService.exe" KeyPath="yes" Vital="yes" DiskId="1"/>
<ServiceInstall
Id="TestWCFService"
Name="TestWCFService"
Account="LocalSystem"
Start="auto"
Interactive="no"
Type="ownProcess"
Vital="yes"
ErrorControl="critical" />
<ServiceControl Id="TestWCFService" Name="TestWCFService" Start="install" Stop="both" Remove="both" Wait="yes" />
</Component>
<Component Id ="TestWCFService.Config" >
<File Name="TestWCFService.Config" Source = "$(var.TestWCFService.TargetDir)TestWCFService.exe.Config" />
</Component>
<File Name="TestUtilities.dll" Source= "$(var.TestWCFService.TargetDir)TestUtilities.dll" />
</Component>
<Component Id="NLog.dll">
<File Name="NLog.dll" Source= "$(var.TestWCFService.TargetDir)NLog.dll" />
</Component>
</ComponentGroup>
WIX output exe package will be installed successfully(as windows service) and auto started. After that when i test using same WCF test client i don't see service running.
Following answer i got it from WIX community From Joe:
Installed program was looking for TestWCFService.exe.Config but we had deployed same file with different extension name TestWCFService.Config.