tags:

views:

939

answers:

4

I have a client-server application, in which the client communicates with the server using WCF (WCF is used both in the client and the server). My problem is, that instantiating the auto-generated proxy in the client, in the following way:

 new Service1Client() 
takes constantly 15.xxx seconds. I tried to solve this problem, and came to the following results:

1) Compiling and running the same code on other computers, ends up in the same way (always 15.xxx seconds).

2) Instantiating the proxy using ChannelFactory.CreateChannel< IService1 >() doesn't help (it gives the same result).

My guess, is that whenever the channel factory creates a channel, it tries to do something with a 15 seconds timeout, and when it fails, it continues with creation.

By the way, I use .Net 3.5 without SP1, and cannot upgrade to SP1 :(

Thanks ahead

A: 

I've seen this before, where the time was being taken in looking for a proxy server. Check your WinINET (Internet Explorer) proxy settings.


My specific reason for thinking "proxy server" is that it takes 15s. 15s sounds like a nice round number for a network timeout.

John Saunders
Thanks, I will try to check this. Although it is weird that on instantiation it looks for a proxy server - this should be performed during the first operation call or something...
Andy
I think that wasn't the problem... there was no proxy server defined on that computer.
Andy
I suggest you watch it with Fiddler or something to see if there's something going on with the network. 15s is too perfect.
John Saunders
I used wireshark to see whether there is some network activity during the instantiation, but it didn't show me something unusual
Andy
This surprises me. The next step would be general profiling using something like AQtime from Automated QA, dotTrace from JetBrains, etc.
John Saunders
Well, eventually we decided to install SP1, and the problem just disappeared... Unfortunately I don't have any of those profiling tools, so I guess that the problem will remain mysterious.. Thanks for tour help!
Andy
A: 

What is the configuration like? I wonder if it is trying to do some kind of connect (security, etc) to the server...? You might also try a network trace (wireshark etc) during this period.

Marc Gravell
I don't try to connect to the server at all - I just create a new instance of the proxy. Calling the method on the proxy, is much faster.Service1Client c = new Service1Client() // takes 15 secondsc.PerformOperation() // takes 1 second
Andy
A: 

Do you have expensive Service Behaviors configured that could be eating up resources? These execute when the host starts up...

Adam Fyles
A: 

Even though it is already outdated, it may be useful for somebody else searching for the same. Problem could be with DNS resolution problem, that might be solved in SP1. So you can check if it happens only when you use host name or also with specified IP address.

Littlesmith