0

I have created a windows service and its job is to start a WCF service in the same project.Now i have a windows client in a project within the same solution. i have added the service reference on the client successfully but when i type in the service reference in the using as shown below it is not recognized. Anybody know whats going on here ? I have tried this numerous times. I am using visual Studio 2012. I have used WCF successfully before on 2010 (not saying that that is the issue)

Client Code

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Serv.......  //************ The reference is not recognized

namespace Validstate_Client
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {



        }
    }
}

Client App.Config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IService2" />
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:8733/Design_Time_Addresses/ValidStateService/Service2/"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService2"
                contract="ServiceReference2.IService2" name="BasicHttpBinding_IService2" />
        </client>
    </system.serviceModel>
</configuration>
user1438082
  • 2,740
  • 10
  • 48
  • 82
  • 1
    One of the buttons in the Solution Navigator is "Show All Files". If you click this, you can expand your service reference in the client project and open the Reference.cs file, where you can see what namespace the generated code is in. – Tim S. Sep 09 '13 at 19:31

1 Answers1

1

The service should live in the Validstate_Client namespace. The following using statement should work:

using Validstate_Client.ServiceReference2
Ixnay
  • 58
  • 3