开发者

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

开发者 https://www.devze.com 2023-02-14 16:52 出处:网络
I\'ve got a WCF service that\'s using file-less activation: <bindings> <basicHttpBinding> <binding transferMode=\"Streamed\">

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.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>


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

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

(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>


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号