| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 624 人关注过本帖
标题:求助:WCF ICP问题
只看楼主 加入收藏
begtostudy
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2006-6-25
收藏
 问题点数:0 回复次数:0 
求助:WCF ICP问题
我想采用NetNamedPipeBinding实现两个本机进程通信,服务端没报错,但是Add Service报错

客户端使用net.pipe://localhost/Service/CalculatorService
Add Service报错:
元数据包含无法解析的引用:“net.pipe://localhost/Service/CalculatorService”。
元数据包含无法解析的引用:“net.pipe://localhost/Service/CalculatorService”。
If the service is defined in the current solution, try building the solution and adding the service reference again.

请问我客户端代码有什么问题吗?
谢谢


服务端部分代码:
    class Program
    {
        static void Main(string[] args)
        {

            // Step 1 of the address configuration procedure: Create a URI to serve as the base address.
            Uri baseAddress = new Uri("net.pipe://localhost/Service");

            // Step 1 of the hosting procedure: Create ServiceHost
            ServiceHost selfHost = new ServiceHost(typeof(CalculatorService), baseAddress);
            try
            {
                // Step 3 of the hosting procedure: Add a service endpoint.
                selfHost.AddServiceEndpoint(
                   typeof(ICalculator),
                   new NetNamedPipeBinding(NetNamedPipeSecurityMode.None),
                    "CalculatorService");

                // Step 4 of the hosting procedure: Enable metadata exchange.
                //ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
                //smb.HttpGetEnabled = true;
                //selfHost.Description.Behaviors.Add(smb);

                // Step 5 of the hosting procedure: Start (and then stop) the service.
                selfHost.Open();
                Console.WriteLine("The service is ready.");
                Console.WriteLine("Press <ENTER> to terminate service.");
                Console.WriteLine();
                Console.ReadLine();

                // Close the ServiceHostBase to shutdown the service.
                selfHost.Close();
            }
            catch (CommunicationException ce)
            {
                Console.WriteLine("An exception occurred: {0}", ce.Message);
                selfHost.Abort();
            }
        }
    }

搜索更多相关主题的帖子: WCF ICP 
2010-04-08 16:59
快速回复:求助:WCF ICP问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028304 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved