服务'xxx'没有应用程序(非基础结构)端点 [英] Service 'xxx' has zero application (non-infrastructure) endpoints

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

问题描述

大家好,



我想在没有IIS的情况下托管我的'WCF REST'服务。我使用了以下网址( http:// msdn。 microsoft.com/en-us/library/community/add/ms733069(v=vs.90).aspx [ ^ ])并成功实现了给定的样本。



但是当我尝试实现我的WCF Rest服务时,我得到以下异常....



Hi All,

I would like to host my 'WCF REST' service without IIS. I have used the following url (http://msdn.microsoft.com/en-us/library/community/add/ms733069(v=vs.90).aspx[^]) and successfully implemented the sample given.

But when I tried to implement my WCF Rest service, I got the following exception....

Service 'xxx' 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.





我的app.config内容如下:





Contents of my app.config is given below....

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <services>
      <service name="Microsoft.ServiceModel.Samples.RestService"

               behaviorConfiguration="RestServiceBehavior">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8000/ServiceModelSamples/service"/>
          </baseAddresses>
        </host>
        <endpoint address=""

                  binding="wsHttpBinding"

                  contract="Microsoft.ServiceModel.Samples.IRestService" />
        <endpoint address="mex"

                  binding="mexHttpBinding"

                  contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="RestServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="False"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>





有人可以帮我解决这个问题吗?



谢谢&问候

Sebastian



Can someone help me to solve this?

Thanks & regards
Sebastian

推荐答案

您好sebastin,

您的服务名称

< ; service> name =Microsoft.ServiceModel.Samples.RestService/>

应与Service命名空间相同。这对我有用。
Hi sebastin,
Your service name
<service>name="Microsoft.ServiceModel.Samples.RestService" />
should be same as Service namespace. this work for me.


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

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