##Anyone using WCF in a container ?
ASPNet WCF Service should respond, but is not recognised.
[WebException: The remote server returned an error: (404) Not Found.]
System.ServiceModel.Channels.HttpChannelRequest.WaitForReply(TimeSpan timeout) +75
[EndpointNotFoundException: There was no endpoint listening at http://localhost/MyWcfService/Service1.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.]
I have a simple WCF web application which does not work on a Windows Server 2016 Container.
What I think the problem is that .svc handler mapping is missing… see
WCF on IIS8; *.svc handler mapping doesn’t work
When I try to add the handler using
dism /Online /Enable-Feature /FeatureName:WCF-HTTP-Activation
I get this error:
The source files could not be found. Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077.
Doing this makes no difference:
Dism /Online /Cleanup-Image /RestoreHealth
It feels like I must be doing the wrong thing if I need to setup a source for DISM.
Any Ideas ?
Steps to reproduce the behavior
- Create a WCF web application
- Make it available in a Windows Server 2016 Container, built from microsoft/iis.
- Make a call to it using a client.
The container was built using the following dockerfile:
FROM microsoft/iis RUN powershell add-windowsfeature web-asp-net45 COPY . c:/install WORKDIR c:/install/ SHELL ["powershell", "-command"] # remove default web site, add my wcf web application RUN Remove-WebSite -Name 'Default Web Site'; \ New-Website -Name 'my-app' -Port 80 -PhysicalPath 'C:\install' -ApplicationPool '.NET v4.5' ENTRYPOINT powershell