Click here to Skip to main content
12,694,691 members (32,865 online)
Rate this:
Please Sign up or sign in to vote.
See more: .NET3.5 .NET WCF security , +
Hi All,

In My winform application I have implemented self hosted WCF service accessible only on LAN.

Previously my app was in framework 3.5, now I have migrated to 4.0.

My application is ment to start on windows startup, and previously it was working fine.

After the migration from 3.5 to 4.0. It has started taking around 1.5 minutes to strart.

Do any of you have any Idea about this annoying delay.

Posted 29-May-11 22:57pm
SAKryukov 30-May-11 4:12am
Not enough information.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Please check with the app.config file with your application, the only delay might happen due to your config file, else there is nothing else to happen this kind of issue ...

Check if your config has been changes as per the change in framework
for e.g.

  <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>

Also check with the necessary bindings reflected properly in your config. or just delete your existing config and create new (Delete and updated the web references again)

Cheers ...
Nitin_Verma 30-May-11 4:46am
this startup tag is there in my config file.

the delay is being caused by the code which starts my wcf service, and not when consuming the service.

the code to start the service is below:
Public Sub StartWCFServer()
'Step 1 of the address configuration procedure: Create a URI to serve as the base address.
Dim baseAddress As Uri = New Uri("http://localhost:8080/Indianet/ClientService")

'Step 2 of the hosting procedure: Create ServiceHost
Dim selfHost As New ServiceHost(GetType(WCFService), baseAddress)

'Step 3 of the hosting procedure: Add a service endpoint.
selfHost.AddServiceEndpoint(GetType(IndianetContract.IServerManager), New WSHttpBinding(SecurityMode.None), "WCFService")

'Step 4 of the hosting procedure: Enable metadata exchange.
Dim smb As New ServiceMetadataBehavior()
smb.HttpGetEnabled = True

'Step 5 of the hosting procedure: Start (and then stop) the service.
Catch ex As Exception
MsgBox("An instance of Indianet client is already running.")
End Try
End Sub

And It was working fine means no delay when it was in framework 3.5.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

framework 4 introduced the binaryHttpBinding, which is helping the transfer the data faster across internet .. you can try this as well ..

you need to change the default binding (wsHttpBinding) to custom binding as binaryHttpBinding

 <binding name="binaryHttpBinding">

Cheers ...
Nitin_Verma 30-May-11 6:19am
Yogesh thanks for replying,

I actually dont have performance issue.
My problem is slow startup of service only on boot time.
and that to only in framework 4.0.

Nitin Verma

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 30 May 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100