tags:

views:

28

answers:

1

Hello,

I am using C#.net application code.

I require to call service for Window Application and i am using below code to open service Host,

 using (ServiceHost host = new ServiceHost(
                typeof(class1),
                new Uri[] { new Uri("net.pipe://localhost") })
                )
            {
}

& Then we have clinet Console application to connect to serviceHost.

Problem is,

When i create service/Client application Using Conslole Application both are working fine. But if i call servide code form Window application to connect to console client it gives Error for Binding Error like("No End Point/Address found to test")

Can any one help me to run service from C# window application ?

Thanks

+2  A: 

You have a using statement wrapped around your host. Once it goes out of scope, it is closed. Make the host a class member of your form. I usually also open it in a separate thread.

Khadaji
hey thanks Khadaji, i got that its because of using statement
Mariya