.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

WCF Service: takes very long time to start up

Posted By:      Posted Date: August 29, 2010    Points: 0   Category :WCF
Hi, What could be the reasons, why my WCF service takes up to 40 seconds to get started? My service class is set to [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)] I am running a thread inside this class. The WCF service gets initialized and opened within the context of this thread. The Initialization: private void InitializeWCFService() {      // initialize servcie base addrresses      this.SetupBaseAddresses();      //MetaData behaviour : allow HttpGet      ServiceMetadataBehavior metaDataBehavior = new ServiceMetadataBehavior();      metaDataBehavior.HttpGetEnabled = true;      // initialize service host instance      this.seviceHost = new ServiceHost(this, this.httpBaseAddress, this.tcpBaseAddress);      // add service endpoints and behavior.      this.seviceHost.AddServiceEndpoint(typeof(IUpdateServer), this.GetServerBinding(BindingType.Tcp), EndpointName);      this.seviceHost.AddServiceEndpoint(typeof(IUpdateServer), this.GetServerBinding(BindingType.Http), EndpointName);      this.seviceHost.Description.Behaviors.Add(metaDataBehavior);      // MEX endpoint      this.seviceHost.AddServic

View Complete Post

More Related Resource Links

Why does it takes such a long time to load a parameter?

Hi all,   I have a parameter which is filled with a set of about 90.000 rows. When running the report, it takes a long time to view the report. While it loads the report the CPU on the client is getting up with 50% and the memory stacks 300 MB. I think that I am doing something wrong as when I run the query directly at the cube, it takes just 9 seconds. Does anybody have coped with this problem? If so, what are the best practices in this? Your help will be greatly appreciated! Daniel

How to measure WCF start up time ? ( WCF service .NET 3.5 hosted in IIS6 under win 2003 )

Hi ,   I have relative big and complex WCF (.net 3.5)service hosted in IIS 6 .  When IIS worker goes down , it takes a lot of time for service to wake up.  My question is how can I measure what exactly takes time ? Or its just service compilation time and nothing could be done here ? If I know what takes time I will try to optimize it .    Thanks. 

Closing a WCF connection takes a long time when using SSL


I have a very puzzling problem closing WCF connections. We utilize several different protocols for different customers. The most common is net.tcp. We now have a customer that requires SSL encryption of their WCF calls. It does seem to work, but exhibits some strange behavior when we close the connection.

Closing the connection takes a long time. This could be caused by any number of problems, but the strange thing is that the more data that was transmitted on the connection, the longer it takes to close. Connections that get a small amount of data close reasonably fast, but if a large amount of data was transmitted, closing the connection can take as long as actually retrieving the data. It almost seems as if the data is being retransmitted back to the server for verification before the connection is closed.

We are using reliable sessions and Binary over HTTP protocol.

ASP.NET upgrade seems to be taking a very long time to start


At work I'm tryhing to upgrade an ASP.NET 2.0 app (which we wrote using VB.NET 2005) to ASP.NET 4.0.  I had a few problems during the upgrade, but eventually worked them all out.  At the end of the day I decided to give it a quick compile and see if I'd get the start page, so I hit F5 in VS 2010.  I left it that way, and man was it acting weird.  VS 2010 wasn't responding to anything.  If I hovered the mouse over VS 2010's minimize or close buttons, in the upper right corner, then those buttons were flashing very rapidly.  I'm not sure what was going on.  After waiting 15 minutes to see if it would come up, I decided to try clicking on the close button.  Nothing happened.  Eventually, I had to leave (I take public transit, and I have to leave when the bus comes), but I thought I'd leave it going as is, in hopes that it might fix itself.

But what I want to know is this, is this pretty standard behavior?  Does it normally take this long to do this?  This website is of modest size (<100 pages).

SSIS - OLE DB from VIEW takes long time



I have a question regarding SSIS 2008 and how it handles views. I hope the answer for this question will be a quick "Get a hotfix" heh.


I am experiencing a very odd behavior with setting up a View as a data-source in OLE DB. I have set up a a very simple package (for experimenting) with a Data Flow Task that has only two components, Data-Source and Data-Destination. I have set the data-source to a view and the destination to a table in the same database.

Note: I am developing the package on the server itself.


  • While trying to preview data-source I get an error, "Query Timeout expired (Microsoft SQL Server Native Client 10.0)
  • When executing the package Validation, Pre-Execute phases are complete but no rows are passing through the buffer. I have waited over 12 hours before stop the job. Checking the monitoring verified that IO was on 1. And that no object was locked , which may have caused the package to run so long or not to retrieve data.
  • When connecting to SSMS and doing export of data from the view - it also retrieves no data and the process seems to be stuck.


Additional data:

  • T

first login takes a long time


hi all,

i have set up a moss site, and i notice an interesting thing that the first login of every day usually takes a long time, while subsequent logins of the same day  take  much less time. what could be the problem? is it related to caching behavior?

any suggestions on how to improve the response speed?


Andrew Chen
BI, Data Mining, Analytical CRM

Why WPF bug fixes takes so long time?



Why the feedbacking takes so long time to get official comments? I'm not speaking about getting the issues to be fixed as it takes even more.

The perfect sample:


It is a known bug for a three years (there is a link to a first discussion in a feedback comment), and the offical answer is:

Posted by Microsoft on 8/21/2009 at 2:35 PM
I do understand your concern, but we are beyond our ZBB date, therefore only ship-blocker bugs make the bar at this point. Considering that we have shipped this bug before, it is hard to make a case that we need to fix it in this release since it did not block our previous release. Thank you.

So, the official policy is "Now, we have a six months before RTM but we will not fix any bugs but those that blocks tth product shipment"? Perfect!

I've a bunch of bugs/suggestions submitted and (for most of them) there's no single comment neither reaction for a six month for now. I'm

Workflows take a long time to start programatically


This is a reposting from "SharePoint 2010 Long Starting if start workflow programatically" by OlegO because I've ran into the same issue and can not find Oleg's re-post to a more appropriate forum as suggested by Clayton Cobb. Oleg writes:

In SharePoint 2010, I'm starting workflow #2 programatically from my workflow #1. See code below:

	SPList currentList = web.Lists[new Guid(ListId)];
	SPListItem currentListItem = currentList.GetItemById(ListItem);

	//resolve any lookup parameters
	string workflowId = base.ProcessStringField(WorkflowIdentifier);

	//find workflow association by name
	SPWorkflowAssociation workflowAssoc = currentList.WorkflowAssociations.GetAssociationByName(workflowId, 

	if (workflowAssoc != null)
		//start the workflow
		SPWorkflow workflow = site.WorkflowManager.StartWorkflow(currentListItem, workflowAssoc, 

WorkflowApplication.Load takes a long time


When I load a persisted WF instance, I can watch a profiler of the DB activity.  From the time I step over .Load until I see the LoadInstance stored procedure execute is taking anywhere from 5 to 10 seconds.  Is there a way to alter this behavior?

Here is how I am creating the Instance Store:

 public class WorkflowLoader : IDisposable
  public SqlWorkflowInstanceStore InstanceStore { get; private set; }
  InstanceHandle mInstanceHandle;
  private string mConnectionString;

  public WorkflowLoader(string connectionString)
   mConnectionString = connectionString;

  public WorkflowApplication CreateInstance(Activity activity, IDictionary<string,object> inputs)
   // if we dont have an instance store, then we have been disposed already

SqlCeConnection.Open() takes very long time


SqlCeConnection.Open() takes very long time if the sdf file is more than 300MB, actually, SqlCeConnection.Open()  will not response in Windows Mobile 6.5 device, but it works in Windows 7.

string connectionString = @"Data Source=\Navigator\tnmsdb_DISTRICT-00001-00008-00017.sdf;Max Database Size = 280";

Cannot Start Search service.


Application Server Administration job failed for service instance Microsoft.Office.Server.Search.Administration.SearchServiceInstance (9ca20163-f0f2-412c-a3ea-927a20205285).

Reason: Could not access the Search service configuration database 

Techinal Support Details:
Microsoft.Office.Server.Search.Administration.DatabaseException: Could not access the Search service configuration database   ---> System.Runtime.InteropServices.COMException (0xC004122D): Could not access the Search service configuration database 
   at Microsoft.Office.Server.Search.Administration.MSSITLB.IGatherApplications2.Mount(String bstrName)
   at Microsoft.Office.Server.Search.Administration.GathererApplication.ProvisionGathererApplication()
   at Microsoft.Office.Server.Search.Administration.GathererApplication.Provision()
   at Microsoft.Office.Server.Search.Administration.OSSIndexGathererApplication.Provision()
   at Microsoft.Office.Server.Search.Administration.SearchApi.<>c__DisplayClass20.<AddApp>b__1f()
   at Microsoft.Office.Server.Search.Administration.SearchApi.RunOnServer[T](CodeToRun`1 remoteCode, CodeToRun`1 localCode, Boolean useCurrentSecurityContext, Int32 versionIn)
   --- End of inner exception stack trace ---

SharePoint 2010 Long Starting if start workflow programatically


In SharePoint 2010, I'm starting workflow #2 programatically from my workflow #1. See code below:

					SPList currentList = web.Lists[new Guid(ListId)];
					SPListItem currentListItem = currentList.GetItemById(ListItem);

					//resolve any lookup parameters
					string workflowId = base.ProcessStringField(WorkflowIdentifier);

					//find workflow association by name
					SPWorkflowAssociation workflowAssoc = currentList.WorkflowAssociations.GetAssociationByName(workflowId, Thread.CurrentThread.CurrentCulture);

					if (workflowAssoc != null)
						//start the workflow
						SPWorkflow workflow = site.WorkflowManager.StartWorkflow(currentListItem, workflowAssoc, workflowAssoc.AssociationData, SPWorkflowRunOptions.Synchronous);

And workflow #2  will hang with Starting status (1-10 minutes), Then the workflow #2 status would be modified  to Completed.

I couldn't find how to start the workflow # 2 immediately and complete immediately without several minutes delay

STSADM ActivateFeature takes too long



I have a solution installed to a web application, this Web App has a lot of Site Collections, these site collections were created with different versions of the wsp package. What I need is a way of activating the new features on the already provisioned site collections.

At first we made a Web Application scoped feature that went through all site collections that were using our template and then activated the features on each site collection but it was giving us a whole bunch of trouble were the code would skip entire site collections or enter the site collection, changing a field that we used for control and not activating anything... Now we have a Web scoped feature that activates all the features within the site collection at either Web or Site scope that we specify through an XML. This works like a charm for every site collection.

The problem is that we need a way of activating that feature on every site collection so I did a batch file that runs the STSADM ActivateFeature to do this. This also works properly but seing the many site collections that we have it is taking more than an hour and a half to finish the batch; is there a way of optimizing this so it runs quicker?

I think that the batch is actually waiting untill the feature is done activating to start to activate the feature on the next site collection, is there a way of a

How to Hide Start Time and End Time for All Day Event in Sharepoint Calendar DispForm

Hi All, Currently, when I add my Calendar web part to my page it displays the date and time for start and end dates. How can I get my web part to hide the times and only show the start and end date when the All Day event box is checked?

Use Sharepoint Calendar Start Time field in calculated column

I'm trying to limit the calendar view to current week using the Sharepoint defined field Start Time. However, when I display the serial number behind the Start Time it looks like it is actually giving me the serial number for the Created Date field. I believe it is because the appointment is reoccurring but I'm hoping there is a way around it. I created a new testdate field and manually entered the date and set those appointments as all day events however they are not reocurring appointments. The testdate returns the correct serial number however the start time returns an incorrect serial number. SerialNumber1=DATE(YEAR([Start Time]),MONTH([Start Time]),DAY([Start Time])) SerialNumber2=DATE(YEAR([testdate]),MONTH([testdate]),DAY([testdate])) Start Time  SerialNumber1 Testdate  SerialNumber2 8/31/2010 40420 8/31/2010 40421 8/31/2010* 40405    9/1/2010* 40405    9/2/2010* 40405    9/7/2010 40427 9/7/2010 40428 9/13/2010* 40405    9/14/2010 40434 9/14/2010 40435 9/14/2010* 40405    9/15/2010* 40405    *These are reoccurring appointments scheduled as all day events. The others were entered as one time appointments scheduled as all day events.

WCF - First call to Callback instance from Server takes considerable time to make it to the client.

Hello. There's a performance problem we are facing that we are unable to fix using DuplexChannels. The first call made by the client to the server reaches the server instantly. The first call made by the server to the first client using a Callback proxy will take several seconds to reach the client. All subsequent calls to the client (as well as other clients) will reach and execute instantly. The client connects to the Server using a proxy to IServiceProvision, supplies an instance to an implementation of IClientCallback and calls IServiceProvision.Start(). The server instantly processes the call and makes an asynchronous call to IClientCallback.DoWork(), which takes several seconds to enter the client's DoWork() implementation. The remainder of the execution then runs smoothly. Also, the server will experience such a slowdown only for the very first call of the first client that connects to it. Is it normal for the Callback interface to take so much time to warmup, only on the first call to the first client? Below is the full source code. Thanks for any information you may provide. Cheers Mike Shared Class Library using System.ServiceModel; namespace Test { [ServiceContract(Namespace = "http://test/IService", CallbackContract = typeof(IClientCallback))] public interface IServiceProvision { [OperationContract] void Start(); [OperationContract] void

SQLDataAdapter/SQLDataReader takes lot of time for executing a query

All, I have a webpage with 6 drop down lists. User can start with selecting any drop down list first, and then proceed in any order.  1. Assume when the 1st dropdown is selected first, rest 5 drop downs (except 1st) are filtered/updated based on the selected value in the 1st dropdown. 2. Assume user selects the 4th dropdown second, rest 5 drop downs (except 4th) will be filtered/updated but the condition would be based on both 1st drop down and 4th drop down. But while filtering the first drop down, only the 4th drop down is used as filter (self-filter will be ignored). The code works fine but I see a very bad performance hit in time when the user selects the fourth dropdown after selecting three drop downs. I tried using both SQLDataAdapter and SQLDataReader but neither used to solve the issue. The code takes a lot of time on one line in either of the code (which is highlighted below). When I run the query in SQLServer Mgmt Studio, the query completes in a few seconds.Using SQLDataReader: SqlConnection conn = new SqlConnection(CONNECTION); SqlCommand ObjCmd = new SqlCommand(query, conn); ObjCmd.CommandTimeout = 600; conn.Open(); SqlDataReader daSelTools = ObjCmd.ExecuteReader(); //This line takes a lot of time ddl.Items.Clear(); // Call Read before accessing data. while (daSelTools.Read()) { ddl.Items.Add(new ListItem(String.Format("{0}",daSelTools[0])));
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend