服务具有零的应用程序(非基础结构)终结点 [英] Service has zero application (non-infrastructure) endpoints

查看:828
本文介绍了服务具有零的应用程序(非基础结构)终结点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近创建了一个WCF服务(DLL)和服务主机(EXE)。我知道我的WCF服务工作正常,因为我能够服务已成功添加到WcfTestClient。

I recently created a WCF service (dll) and a service host (exe). I know my WCF service is working correctly since I am able to successfully add the service to WcfTestClient.

不过,我似乎快成为一个问题,当我来到从一个服务主机(EXE)utlizing我的WCF。我可以添加一个参考WCF(DLL),以我的服务主机(EXE),并建立必要的成品的配件为exe文件;如服务安装,服务宿主,并在app.config,编译,最后使用InstallUtil安装exe文件。但是,当我试图启动Microsoft管理控制台的服务,该服务立即被启动后停止。

However, I seem to be running into an issue when I comes to utlizing my WCF from a service host (exe). I can add a reference to the WCF (dll) to my service host (exe) and create the necessary componets to the exe; such as the service installer, service host, and the app.config, compile and then finally install the exe using InstallUtil. But, when I tried to start the service in the Microsoft Management Console, the service immediately stops after being started.

于是我开始调查这可能正是会造成这个问题的提出了从应用程序日志这个错误在事件查看器。

So I began investigating what could exactly be causing this issue an came up with this error from the Application Log in the Event Viewer.

说明:

服务将无法启动。   System.InvalidOperationException:   服务服务有零应用   (非基础结构)终结点。本   可能是因为没有配置文件   被发现的应用程序,或者   因为没有服务元素匹配   服务名称可以在找到   配置文件,或者是因为没有   终点在服务定义   元素。

Service cannot be started. System.InvalidOperationException: 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.

实际上是产生这个错误的的OnStart ;我的exe文件,当我执行此调用 ServiceHost.Open()。我见过无数然而职位,而其他人也遇到了这个问题,大多数,如果不是所有的人,声称该服务名称或合同;命名空间和类的名称,都没有被指定。我检查无论是在我的配置文件中的这些条目;在EXE和DLL中的,并且他们匹配完美。我有其他人在我身后的办公室仔细检查,以确保我不是在一个点去盲目的,但当然,他们来到了同样的结论作为我,一切看起来似乎是正确指定。我真的在丢失的是什么,在这一点上怎么回事。谁能帮我解决这个问题?

This error is actually generated in the OnStart; of my exe, when I perform this call ServiceHost.Open(). I've seen numerous posts where other individuals have run into this issue, however most if not all of them, claim that the service name or contract; namespace and class name, are not being specified. I checked both of these entries in my config file; in the exe as well as in the dll, and they match up PERFECTLY. I've had other people in the office double check behind me to make sure I wasn't going blind at one point, but of course they came to the same conclusion as me that everything looked like it was specified correctly. I am truly at a lost as to what is going on at this point. Could anyone help me with this issue?

这是来到了,因为这可能会发生一个可能的原因另一件事是,在app.config永远不会被读取;至少不是一个我认为应该得到阅读。难道这是问题?如果是这样,我该怎么去解决这个问题。同样,任何帮助,将AP preciated。

Another thing that came up as a possible reason this may be happening is that the app.config is never being read; at least not the one I think should be getting read. Could this be the issue? If so, how can I go about addressing this issue. Again, ANY help would be appreciated.

推荐答案

我只是有这个问题,并通过添加命名空间的服务名称解析它,例如:

I just had this problem and resolved it by adding the namespace to the service name, e.g.

 <service name="TechResponse">

成为

 <service name="SvcClient.TechResponse">

我也看到了它解决了Web.config文件,而不是一个app.config。

I've also seen it resolved with a Web.config instead of an App.config.

这篇关于服务具有零的应用程序(非基础结构)终结点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆