【问题标题】:System.ServiceModel.AddressAlreadyInUseException in WCF (Visual Studio 2017)WCF 中的 System.ServiceModel.AddressAlreadyInUseException (Visual Studio 2017)
【发布时间】:2018-08-23 03:13:29
【问题描述】:

我是网络服务领域的新手。我只是在使用教程编写一个简单的服务。 MyService.cs 的代码如下:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestService
 {
   class MyService : IMyService
   {
    public string GetData()
      {
        return "iamchiragsharma.website2.me";
      }
   }
 }

对于 IMyService.cs 是:

using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;

    namespace TestService
{
    [ServiceContract]
    interface IMyService
   {

    [OperationContract]
    string GetData();
   }
}

当我按下 开始 按钮时,出现以下错误:

我尝试过使用HTTP注册检查方法,甚至删除并重新创建了端口,但没有任何帮助。

我想知道这个错误的原因和解决方法? 任何形式的帮助将不胜感激。谢谢。

【问题讨论】:

    标签: asp.net web-services wcf ssl


    【解决方案1】:

    明显的可能性是您在 Visual Studio 之外还有另一个进程在端口 8733 上运行,但我不相信这是这里的问题,因为我猜您已经让 Visual Studio 选择使用该端口。

    我记得读过一个类似的问题,该问题通过以提升的权限运行 Visual Studio(即以管理员身份运行)得到解决。这可能值得一试。

    【讨论】:

    • 您好!我尝试使用以管理员身份运行的方法,但它给出了相同的输出。我几乎尝试了所有常规方法,但我的问题仍未解决。如果需要我的 app.config,我也会提供。
    猜你喜欢
    • 2010-10-02
    • 1970-01-01
    • 2018-04-15
    • 2018-07-20
    • 2017-09-05
    • 2017-08-05
    • 1970-01-01
    • 2018-01-31
    • 1970-01-01
    相关资源
    最近更新 更多