I've created a C# WCF Windows service app in VS 2017 and added Docker Support.
The following Dockerfile was created:
FROM microsoft/dotnet-framework:4.7.1-windowsservercore-1709
ARG source
WORKDIR /app
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["C:\\WcfService.exe"]
When I build it using docker-compose in VS I get an error:
Cannot start service from the command line or a debugger. A Windows Service must first be installed (using installutil.exe) and then started with the ServerExplorer, Windows Services Administrative tool or the NET START command. The program '[2172] WcfService.exe' has exited with code 0 (0x0).
I've opened PowerShell and typed docker ps
- the container is running.
So I used New-Service
command and to create "TestService".
When I use Get-Service
to see all services, I can see it in the list in 'Stopped' mode.
When I use Start-Service TestService
I get the following error:
Start-Service : Failed to start service 'TestService (TestService)'. At line:1 char:1 + Start-Service TestService + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException + FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand
Tried to find info but nothing works. Any ideas?