代码之家  ›  专栏  ›  技术社区  ›  user272671

HTTP“System.InvalidOperationException”异常

  •  0
  • user272671  · 技术社区  · 15 年前

    帮助。当我尝试运行我的服务时,会得到下面的异常。我尝试运行命令行fix netsh http add iplisten ipaddress=127.0.0.1:8439来解决问题。问题是我得到一个IP地址成功添加的消息,但我仍然得到以下错误,当我运行我的应用程序。你知道我该怎么办吗?

    System.ServiceModel.dll中发生“System.InvalidOperationException”类型的未处理异常。

    其他信息:uri'的注册已经存在 http://127.0.0.1:8439/ '.

    2 回复  |  直到 15 年前
        1
  •  0
  •   nitzmahone    15 年前

        2
  •  0
  •   user272671    15 年前

     CustomBinding custombinding = new CustomBinding();
            custombinding.Elements.Add(new HttpTransportBindingElement());
            BindingParameterCollection paramCollection = new BindingParameterCollection();
            IChannelListener<IReplyChannel> listener = custombinding.BuildChannelListener<IReplyChannel>(new Uri(textBoxURI.Text), paramCollection);
            listener.Open();
    
            IReplyChannel channel = listener.AcceptChannel();
            //Start listening 
            channel.Open();
            //process received messages
            RequestContext request = channel.ReceiveRequest();
    
    推荐文章