using System; using System.ServiceModel; namespace EssentialWCF { [ServiceContract] public interface IStockService { [OperationContract] double GetPrice(string ticker); } public class StockService : IStockService { public double GetPrice(string ticker) { return 94.85; } } class Service { static void Main(string[] args) { ServiceHost serviceHost = new ServiceHost(typeof(StockService), new Uri("http://localhost:8000/HelloWCF")); serviceHost.AddServiceEndpoint(typeof(IStockService), new BasicHttpBinding(), ""); serviceHost.Open(); Console.WriteLine("To continue press <ENTER>.\n\n"); serviceHost.Close(); } } }
Quote:HTTP could not register URL http://+:8000/HelloWCF/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details).
Just Save the Solution --> Close the VS --> again Right click on VS startup Icon --> select option "Run as Administrative" --> again open your WCF Host Project and RUN the Service
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)