端口
  
*****************************************************************************
签名档: http://feiyun0112.cnblogs.com/

解决方案 »

  1.   

    随机产生的。代表一个没有使用的端口。你的Host程序会用它来监听服务。
      

  2.   

     源码是这样的  using (ServiceHost host = new ServiceHost(typeof(CalculatorService)))
                {
                    host.AddServiceEndpoint(typeof(ICalculator), new WSHttpBinding(), "http://127.0.0.1:3721/calculatorservice");
                    if (host.Description.Behaviors.Find<ServiceMetadataBehavior>() != null)
                    {
                        ServiceMetadataBehavior behavor = new ServiceMetadataBehavior();
                        behavor.HttpGetEnabled = true;
                        behavor.HttpGetUrl = new Uri("http://127.0.0.1:3721/calculatorservice/metadata");
                        host.Description.Behaviors.Add(behavor);
                        host.Opened += delegate
                        {
                            Console.WriteLine("CalculatorService已启动服务,按任意键终止服务");
                        };
                        host.Open();
                        Console.Read();
                    }
                }我是看wcf全面解析里面的教程,这个calculatorservice是在类库里面。我怎么能知道那个端口号呢。是不是要把类库发布在IIS,如果是如何发布啊。