【发布时间】:2012-02-27 23:26:21
【问题描述】:
我正在尝试创建一个 wcf 服务
但它在运行时一直困扰我以下错误
HTTP 无法注册 URL http://+:80/ConsoleWCFapp/。您的进程无权访问此命名空间(详情请参阅http://go.microsoft.com/fwlink/?LinkId=70353)。
代码
static void Main(string[] args)
{
ServiceHost host = new ServiceHost(typeof(StockService), new Uri("http://localhost:8000/ConsoleWCFapp"));
host.AddServiceEndpoint(typeof(IStockService), new BasicHttpBinding(), "");
host.Open();
Console.WriteLine("Listening to request now, Please enter to exit \n\n");
Console.ReadLine();
host.Close();
}
请指教
【问题讨论】:
标签: wcf