When I start ServiceMonitor inside a container for the first time, I see the following output:
PS C:> .\ServiceMonitor.exe w3svc
Service 'w3svc' has been stopped
ERROR ( message:Cannot find requested collection element. )
APPCMD failed with error code 4312
Applied configuration changes to section "system.applicationHost/applicationPools" for "MACHINE/WEBROOT/APPHOST" at configuration commit path "MACHINE/WEBROOT/APPHOST"
ERROR ( message:Cannot find requested collection element. )
APPCMD failed with error code 4312
Applied configuration changes to section "system.applicationHost/applicationPools" for "MACHINE/WEBROOT/APPHOST" at configuration commit path "MACHINE/WEBROOT/APPHOST"
Service 'w3svc' started
Terminating it and starting ServiceMonitor again results in the following output:
PS C:> .\ServiceMonitor.exe w3svc
Service 'w3svc' has been stopped
Applied configuration changes to section "system.applicationHost/applicationPools" for "MACHINE/WEBROOT/APPHOST" at configuration commit path "MACHINE/WEBROOT/APPHOST"
Applied configuration changes to section "system.applicationHost/applicationPools" for "MACHINE/WEBROOT/APPHOST" at configuration commit path "MACHINE/WEBROOT/APPHOST"
Applied configuration changes to section "system.applicationHost/applicationPools" for "MACHINE/WEBROOT/APPHOST" at configuration commit path "MACHINE/WEBROOT/APPHOST"
Applied configuration changes to section "system.applicationHost/applicationPools" for "MACHINE/WEBROOT/APPHOST" at configuration commit path "MACHINE/WEBROOT/APPHOST"
Service 'w3svc' started
These errors (in the first quote) happen only if starting ServiceMonitor manually. Without overriding the entry point, everything works as expected and the output looks like:
Service 'w3svc' has been stopped
Service 'w3svc' started
Since the default entry point and manually starting ServiceMonitor is the same command in this case, I'd expect the output to be the same - without any errors.
In order to reproduce these errors:
- Pull the latest image:
docker pull microsoft/aspnet
(I tried 4.6.2 and 4.7 - the result is the same).
- Enter the container by overriding the default entry point:
docker run -it --rm --entrypoint powershell microsoft/aspnet
.
- Inside the container, start ServiceMonitor:
.\ServiceMonitor.exe w3svc
.
The container host is Windows Server 2016 Standard (Version 1607, Build 14393.1593) and the Docker version is 17.03.2-ee-5, build fa09039.
It would be also interesting to know whether these errors can be safely ignored (until they're being fixed). It seems that everything else works as expected, but maybe I don't notice something.