user1438082
user1438082

Reputation: 2748

WCF using reference

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>

Upvotes: 0

Views: 74

Answers (1)

Ixnay
Ixnay

Reputation: 58

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

using Validstate_Client.ServiceReference2

Upvotes: 1

Related Questions