I’ve got a WCF service that’s using file-less activation:
<bindings>
<basicHttpBinding>
<binding transferMode="Streamed">
<security mode="Transport"/>
</binding>
</basicHttpBinding>
</bindings>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true">
<serviceActivations>
<add relativeAddress="RulesService.svc"
service="Big.Company.RulesService.Service, RulesService" />
</serviceActivations>
</serviceHostingEnvironment>
On some machines, I see the following exception:
Service
‘Big.Company.RulesService.Service’ has
zero application (non-infrastructure)
endpoints. This might be because no
configuration file was found for your
application, or because no service
element matching the service name
could be found in the configuration
file, or because no endpoints were
defined in the service element.
As far as I can tell, .svc is correctly mapped to the .NET 4.0 activation module. The application is in the “ASP.NET v4.0” application pool, which is configured for .NET v4.0, using the integrated pipeline.
If I remove the Web.config file, I get a 404 error. If I rename the bin\RulesService.dll file, I get a ‘service not found’ exception.
What’s wrong with it?
Update: It appears to be a problem when turning on SSL. If I connect using HTTPS, it’s fine, until I turn on ‘Require SSL’ in IIS.
An afternoon of using Reflector led me to the
ConfigLoader.AddDefaultEndpointsmethod, which looks at theProtocolMappingSectionof the config file to work out which default endpoints to add.It appears that HTTPS doesn’t set up this section implicitly.
I solved it (with a hint from something I’d seen earlier in the day) by adding the following to my Web.config file: