Server Error in '/***.Location.**Services' Application.
Service '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.
Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.InvalidOperationException: Service 'Sensitech.Location.AppServices.LocationManagerAppService' 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.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
[InvalidOperationException: Service '**.**.**.***ManagerAppService' 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.] System.ServiceModel.Description.DispatcherBuilder.EnsureThereAreApplicationEndpoints(ServiceDescription description) +356 System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost) +120 System.ServiceModel.ServiceHostBase.InitializeRuntime() +93 System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +48 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +307 System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +130 System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +738 [ServiceActivationException: The service '/**.**.**/**AppService.svc' cannot be activated due to an exception during compilation. The exception message is: Service 'Se**n***s*ite**ch.L**oc**a*ti*n*.AppSe***rvices.Loca**tion**Ma**nage*rAppSer*vice' 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..] System.Runtime.AsyncResult.End(IAsyncResult result) +604403 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +238 System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +178 |
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.81.0
有时候部署WCF会遇到这个问题。原因是配置文件中的配置节点binding和IIS中的协议不符合。比较一下配置节点就可以明白。
先看配置节点:
<endpoint address="net.tcp://localhost/Sensitech.Alarm.AppServices/AlarmManagerAppService.svc"
binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IAlarmManagerAppService"
contract="Sensitech.Alarm.Contracts.IAlarmManagerAppService" name="NetTcpBinding_IAlarmManagerAppService">
<identity>
<userPrincipalName value="localhost" />
</identity>
</endpoint>
在检查IIS的配置: 看到behavior 缺少了net.tcp配置。加上之后就好了
将缺少的协议加上
在次调用。就可以了
另外:如果缺少了http,会报这个503的错误