服务没有应用程序(非基础结构)端点

时间:2013-03-11 12:05:27

标签: wcf windows-hosting

我知道其他问题的标题相同。我试过他们的解决方案无济于事

我在使用installutil注册后尝试启动我的服务(Windows托管)时收到此消息。
我对[{1}}没有经验,请耐心等待。

我的服务应用程序由两个项目组成:外部,我有我的服务接口,客户端接口,数据合同和app.config,以及内部,包含服务实现(主机,实际实现完成)在另一个不从我的服务界面继承的文件中,我不确定这是不是一个好习惯。)
我的app.config:

WCF

我的界面:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <services>
      <service name="Internals.ExecutionService" behaviorConfiguration="Default">
        <endpoint name="TCPEndpoint" 
                  address="net.tcp://localhost:8080/ExecutionService" 
                  binding ="netTcpBinding" 
                  contract="Externals.IExecutionService"/>
        <endpoint address="mex" 
                  binding="mexTcpBinding" 
                  contract="IMetadataExhange"/>
        <host>
          <baseAddresses>
            <add baseAddress="netTcp://localhost:8080/ExecutionService"/>
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="Default">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

和实现(实际上还没有准备好,我只是想看看我是否可以让客户端添加服务引用):

using System.ServiceModel;

namespace Externals
{
    [ServiceContract(CallbackContract = typeof(IClientCallback))]
    public interface IExecutionService
    {
        /// <summary>
        /// Executes the mainflow.py file in the provided location.
        /// </summary>
        /// <param name="path">Path to the Python file.</param>
        /// <returns>Execution status. Expected to return Passed/Failed onlt.</returns>
        [OperationContract]
        ExecutionStatus Execute(string path);

        [OperationContract]
        ExecutionStatus GetStatus();
    }
}

接口的空实现。

完整错误:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, IncludeExceptionDetailInFaults = true, ConcurrencyMode = ConcurrencyMode.Multiple, UseSynchronizationContext = false)]
    public partial class ExecutionService : ServiceBase, IExecutionService
    {
        ServiceHost myHost;
        private IClientCallback callbackChannel;

        public ExecutionService()
        {
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            myHost = new ServiceHost(typeof(ExecutionService));
            myHost.Open();
        }
}

取自事件查看器。

1 个答案:

答案 0 :(得分:1)

你的app.config应该是内部的,而不是外部的。将其重命名为Internals.exe.config(或任何您的“internals”exe命名)并将其放在与服务exe相同的目录中。