Roger Lipscombe
Roger Lipscombe

Reputation: 91865

File-less WCF activation results in "zero application (non-infrastructure) endpoints..." exception

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.

Upvotes: 0

Views: 1909

Answers (3)

Guish
Guish

Reputation: 5160

I had only an HTTPS binding in IIS for my service and adding an http binding solved my problem. Without any file configuration.

Add Http binding

(Sorry for the french screenshot )

Adding the following to the config file and removing the http binding in IIS also solved my problem.

<protocolMapping>
   <add scheme="https" binding="basicHttpBinding"/>
</protocolMapping>

Upvotes: 0

Roger Lipscombe
Roger Lipscombe

Reputation: 91865

An afternoon of using Reflector led me to the ConfigLoader.AddDefaultEndpoints method, which looks at the ProtocolMappingSection of 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:

<protocolMapping>
   <add scheme="https" binding="basicHttpBinding"/>
   <add scheme="http" binding="basicHttpBinding"/>
</protocolMapping>

Upvotes: 4

user698883
user698883

Reputation: 65

I had the identical problem at work and it was a permissions issue.

Upvotes: -1

Related Questions