When i tried to add the reference of restful wcf service to windows service. I am getting "The type or namespace name 'RestfulService' could not be found (are you missing a using directive or an assembly reference?)" error.

**MY Interface Is**

```
[ServiceContract(Name = "RJContract",
     Namespace = "RestfulService",
     SessionMode = SessionMode.Allowed)]
    public interface IService1
    {
        [OperationContract]
        [WebGet(UriTemplate = "/rjdata/{name}")]
        string RJData(string name);
    }

```

**App.Config**

```
<system.serviceModel>
    <services>
      <service name="RestfulService.Service1">
        <host>
          <baseAddresses>
            <add baseAddress = "http://localhost:8732/RestfulService/Service1/" />
          </baseAddresses>
        </host>
        <endpoint  binding="webHttpBinding" contract="RestfulService.IService1" bindingConfiguration="RESTBindingConfiguration"
                   behaviorConfiguration="RESTEndpointBehavior"/>

      </service>
    </services>

    <bindings>
      <webHttpBinding>
        <binding name="RESTBindingConfiguration">
          <security mode="None" />
        </binding>
      </webHttpBinding>

      <netTcpBinding>
        <binding name="DefaultBinding">
          <security mode="None"/>
        </binding>
      </netTcpBinding>

    </bindings>

    <behaviors>
      <endpointBehaviors>
        <behavior name="RESTEndpointBehavior">
          <webHttp helpEnabled="true" defaultOutgoingResponseFormat="Json" automaticFormatSelectionEnabled="true"/>
        </behavior>
      </endpointBehaviors>

      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="True"/>
          <serviceDebug includeExceptionDetailInFaults="False" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" />
  </system.serviceModel>

```

But i am able to add the reference with the following.

```
 [ServiceContract(Name = "RJContract",
         Namespace = "RestfulService",
         SessionMode = SessionMode.Allowed)]
        public interface IService1
        {
            [OperationContract]
            string RJData(string name);
        }

```

**In windows Hosting**

```
public partial class Service1 : ServiceBase
    {
        public Service1()
        {
            InitializeComponent();
        }
        ServiceHost sHost;
        protected override void OnStart(string[] args)
        {
            try
            {
                sHost = new ServiceHost(typeof(RestfulService.Service1));
                sHost.Open();
            }
            catch (Exception ex)
            {
                EventLog.WriteEntry(ex.Message);
            }
        }

        protected override void OnStop()
        {
        }
    }

```

where RestfulService is my reference to the wcf service