Wcf DevForce服务器控制台-没有端点侦听

Wcf DevForce服务器控制台-没有端点侦听,wcf,devforce,Wcf,Devforce,我有一个使用免费Windows应用商店许可证的基本DevForce Windows应用商店应用程序 当作为Web项目运行时,我能够成功地执行查询 但是,当使用ServerConsole.exe托管时,我会遇到以下异常: 没有端点正在侦听 http://localhost:63191/EntityService.svc/winrt可以接受呼叫的 从这个应用程序。如果在Visual Studio中运行,请确保 为web中的所有IdeaBlade程序集引用设置CopyLocal=true 项目以确保将

我有一个使用免费Windows应用商店许可证的基本DevForce Windows应用商店应用程序

当作为Web项目运行时,我能够成功地执行查询

但是,当使用ServerConsole.exe托管时,我会遇到以下异常:

没有端点正在侦听
http://localhost:63191/EntityService.svc/winrt
可以接受呼叫的 从这个应用程序。如果在Visual Studio中运行,请确保 为web中的所有IdeaBlade程序集引用设置CopyLocal=true 项目以确保将这些程序集复制到bin文件夹。 还要检查global.asax是否包含注册DevForce的代码 VirtualPathProvider,或者EntityService.svc和 EntityServer.svc文件存在。
要检查服务是否正在运行,请打开internet浏览器并 导航到
http://localhost:63191/EntityService.svc
。如果服务 页面显示错误,这些错误应有助于诊断 服务如果服务正在运行,则还要确保 客户端和服务器之间的端点绑定匹配,并且 服务器的ClientApplicationType为“全部”或对此正确 客户有关详细信息,请查看服务器的调试日志文件

解决方案中有三个项目:App1(Windows应用商店)、DomainModel(NET4.5)和App1.Web(Web应用程序)。ServiceConsole.exe已复制到DomainModel的输出目录中

服务器控制台正确报告:

Trying programmatic configuration of EntityService using
ideablade.configuration  section EntityService listening on
http://localhost:63191/EntityService/winrt EntityService listening on
http://localhost:63191/EntityService/wp Press <Enter> to exit server.
这是由于DevForce中的“不适宜”。对于移动客户端,它默认假定EntityService将由IIS托管,并自动附加WCF所需的.svc扩展名

要解决此行为,可以添加DevForce ServiceProxyEvents类的自定义实现,以去掉扩展并替换URI

class ClientProxy : IdeaBlade.EntityModel.ServiceProxyEvents
{

    public override void OnEndpointCreated(System.ServiceModel.Description.ServiceEndpoint endpoint)
    {
        var olduri = endpoint.Address.Uri;
        var newuri = new Uri(olduri.AbsoluteUri.Replace(".svc", string.Empty));
        endpoint.Address = new System.ServiceModel.EndpointAddress(newuri);
        base.OnEndpointCreated(endpoint);
    }
}

将类放置在客户端程序集中,DevForce将“探测”该程序集。

托管在IIS上是一个完全有效的假设。
class ClientProxy : IdeaBlade.EntityModel.ServiceProxyEvents
{

    public override void OnEndpointCreated(System.ServiceModel.Description.ServiceEndpoint endpoint)
    {
        var olduri = endpoint.Address.Uri;
        var newuri = new Uri(olduri.AbsoluteUri.Replace(".svc", string.Empty));
        endpoint.Address = new System.ServiceModel.EndpointAddress(newuri);
        base.OnEndpointCreated(endpoint);
    }
}