WCF as Windows Service

Asked

Viewed 45 times

2

I’m creating a WCF, and it’s like this:

  ServiceHost host = new WebServiceHost(typeof(Server));
            WebHttpBinding binding = new WebHttpBinding();
            binding.MaxReceivedMessageSize = 999999999;
            ServiceEndpoint point = host.AddServiceEndpoint(typeof(IServer), binding, url);
            point.Behaviors.Add(new WebHttpBehavior());
            host.Open();

In a common executable, it worked perfectly, but now I need it working as a Windows service, and when I include it in the service project, it does not recognize the:

using System.ServiceModel.Web;

And returns me error. How can I proceed ? It does not find the properties because it does not recognize Servicemodel.Web.

1 answer

2


Missing to make the reference , if using visual Studio , in the area of the explorer Solution has the references right-click > add Reference > assemblies and add the system.servicemodel.web

Browser other questions tagged

You are not signed in. Login or sign up in order to post.