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

Top 5 Contributors of the Month
Melody Anderson
Eminent IT
Post New Web Links

WCF timeout exception!

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :WCF


I've created a service layer for my application and deployed it in appfabric in the server.

I'm able to access the services fine upto an extent. But after 10-15 calls i get the time out exception.

This is happening everytime. I'm able to access one of the service successfully then , but i'm unable to access the other services.

I'm unable to understand this. I've even set the concurrent calls in the service behavior.

Can any one plz help me.




View Complete Post

More Related Resource Links

Getting "timeout expired" exception


Using vb.net/asp.net 2005 and sql server 2005.

Server:  "Microsoft Windows Server 2003 R2, Enterprise Edition, Service Pack 2

[Moderators please help me out if this is in the wrong section]

I have an admin system where you can enter a CustomerID and then switch to that customer (so that you can edit details as if you are that customer).  However there are certain times when the system is busy that there are "timeout expired" exceptions.

Both the website and the database are on the same server.  When I log onto the server I looked at the Control Panel and "event viewer (application)" to see if there were any issues listed there and found the following that happened at the same time.  Anyways I am trying to find out more information so I can prevent this issue from happening in the future.

I'm wondering how I can look at server performance when timeout issues were reported so that I can pinpoint what the exact cause of the timeouts were.  I see under Control Panel that there is a "performance" tool, but can that only be used for what is happening once you start that tool?

The event detail that I found of timeout is below (function/server and IP names changed because no need for anyone to see those):


Event code: 3005
Event m

timeout period elapsed exception occuring on multiple tables


what facilities are there in sql server to help me track down why I am suddenly getting an unresponsive web app that eventually signals a "timeout expired" exception on a linq to sql SubmitChanges instruction?  First, I was gettng the timeout exception on a single row in a central table. I changed the code to ignore that error and was able to get the app to start ( by browsing to it from the browser. ) Now, 20 minutes later, the same problem is happening on a 2nd table.  Will sql server tell me what rows in what tables are currently locked ?




SSRS 2005 Report timeout, Memory out of Exception

The .net code is executing the ssrs ".rdl" file from the ssrs report viewer.
When the report viewer executes the ".rdl" report file below error is displayed.
Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.

Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.

SSRS 2005 report.
The report displays 10,000 of records successfully, but when the report is supposed to display lakhs of records, the report gets time-out.

I have tried the below changes but still the timeout occurs.
1) In Report manager have selected the "Do not timeout report execution" option.
2) In Machine.config changed the <processModel autoConfig="true" />
to <processModel autoConfig="true" memoryLimit="120"/>
3) In rsreportserver.config changed "MemoryLimit" and "MaximumMemoryLimit" to 120 and 160 respectively.

I had also set the timeout=0 in the sql connecti

Can a timer be used to throw a timeout exception in a WCF operation?


I am developing a webservice for a third party to talk with and they have a requirement of the process running at max 15 seconds.  If the webservice is taking longer than that, then a specific XML reply must be sent back to them to notify that the service is taking too long.

I have tried to do this by encapsulating the 'meat' of the operation in a Try/Catch statement.  Inside the Try portion I create a private scoped System.Timers.Timer with an interval of 15000.  I have a Catch statement that is looking for a TimeoutException which will create the appropriate file when the exception occurs.  There is also an ending Catch statement that just catches any exception and creates another file in that instance.

After I create the timer, I have tried setting Enable to True, setting Enable to True + calling the Start method, and calling the Start method.   After the timer creation/enabling, I am calling a System.Threading.Thread.Sleep(20000).  I have a private shared delegate Sub that is fired when the Timer.OnElapsed event fires.  This Sub has a simple Throw TimeoutException('Timeout Exception Occured!') call in it.

I have tested this each way and none of them seem to actually fire the event on the timer.  The thread sleeps for 20 seconds and then continues on and the service continues on without issue as

TimeOut exception when using MetadataExchangeClient GetMetadata method with valid mex EndpointAddres


Hello all,

I have a ServiceHost with a defined tcp mex endpoint at net.tcp://localhost:9003/MyService/mex. Other code can successfully read metadata from the endpoint.

Using the following code, I get a TimeOut exception with this error message even though the timeout interval is set to 3 minutes:

This request operation sent to net.tcp://localhost:9003/CalculatorService/mex did not receive a reply within the configured timeout (00:03:00).  The time allotted to this operation may have been a portion of a longer timeout.  This may be because the service is still processing the operation or because the service was unable to send a reply message.  Please consider increasing the operation timeout (by casting the channel/proxy to IContextChannel and setting the OperationTimeout property) and ensure that the service is able to connect to the client.

MetadataExchangeClient mexClient = new MetadataExchangeClient(metadataAddress);

// mexClient.HttpCredentials = New System.Net.NetworkCredential()

mexClient.ResolveMetadataReferences = true;

mexClient.OperationTimeout = New TimeSpan(0, 3, 0);

MetadataSet metaDocs = mexClient.GetMetadata();

The metadataAddress comes f


Every self-respected programmer should include exception handling techniques. Sometimes your application will generate an error. Regardless of who was responsible for this error, the programmer or the user, it is up to the first to include the necessary exception handling techniques to keep his/her program from crashing. The .Net environment provides useful techniques for avoiding disastrous errors such as try-catch statements and user-defined exceptions.

Global Exception Handling with ASP.NET

After your global exception handler has done its work, you'll want to redirect the users of your website to a friendly page that tells them that something has gone wrong, and then provide them with customer support information as well as a link back to your web application's home page.

SQL Server 2005 Try and Catch Exception Handling

I'm pretty excited to see that there is some real error handling for T-SQL code in SQL Server 2005. It's pretty painful to have your wonderfully architected .NET solution tainted by less-than-VBScript error handling for stored procedures in the database. The big difference being the addition of TRY..CATCH blocks. Let's take a look:

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is no



 I keep getting the following error. I also added time out parameter in the connection stirng and it still did not help. Has any one faced similar issues.

Thanks in adavance.

Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.]

reader.getordinal("column_may_not_exist") how to catch the exception?



would any body please help me to catch the exception if the column doesnot exist as my table columns are not static.

sometimes its throwing me indexoutofrange exception as the column doesnot exist

thanks for the help guys

SQL 2008 timeout


I am recently getting a timeout exception when executing this method. This table stores images and it might be due to the size of the table. I have no idea! Help!


 Public Sub StoreFile(ByVal fileId As Integer, ByVal upload As Stream, ByVal connection As SqlConnection)
            Dim bufferLen As Integer = 8040
            Dim br As BinaryReader = New BinaryReader(upload)
            Dim chunk As Byte()
            chunk = br.ReadBytes(bufferLen)

            Dim cmd As SqlCommand = _
            New SqlCommand("UPDATE tblContactDocuments SET ContractDocument=@Buffer WHERE AutoID=@FileId", _
            cmd.CommandTimeout = 30
            cmd.Parameters.AddWithValue("@FileId", fileId)
            cmd.Parameters.Add("@Buffer", SqlDbType.VarBinary, bufferLen).Value = chunk

            Dim cmdAppend = New SqlCommand("UPDATE tblContactDocuments SET CONTRACTDOCUMENT.WRITE(@Buffer, NULL, 0) WHERE AutoID=@FileId", _
            cmdAppend.Parameters.AddWithValue("@FileId", fileId)
            cmdAppend.Parameters.Add("@Buffer", SqlDbType.VarBinary, bufferLen)
            chunk = br.ReadBytes(bufferLen)

            While (c

ReadXML Timeout


I am reading an XML file from an external URL and putting it into a dataset that is the populates a repeater. This works fine when I run it locally, however on the published web site I receive A connection attempt failed because the connected party did not properly respond after a period of time error messages.

However, if i type the URL directly into a browser, I get the XML file almost immeadately which leads me to believe that I am going about this the wrong way or I need to some how to extend the timeout period.

Here is my code:

Protected Sub ButtonValidate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonValidate.Click
        If Page.IsValid = False Then
        End If

        TableCellVATSIMIDResults.Text = "<br />VATSIM ID Validation Results for <i>" & TextBoxVATSIMID.Text & "</i>"
        Dim DataSetVATSIMValidation As New DataSet
        DataSetVATSIMValidation.ReadXml("http://cert.vatsim.net/cert/vatsimnet/idstatus.php?cid=" & TextBoxVATSIMID.Text)


<asp:Repeater runat="server" ID="RepeaterVATSIMValidation">
                    <HeaderTemplate />

Error while using exception handling block el 4.1


Hi Folks,


i am trying to use tyhe exception handling block of Enterprise library 4.1.


I just createda polisy and used IndexOutOfRangeException and added a replace handler and a logging handler to it.

I am using the NotifyRethrow PostHandlingAction to the exception.


During runtime I am getting an exception on the HandleException event, The exception is added below:



Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 42:             catch (Exception ex)
Line 43:             {
Line 44:                 bool reThrow = ExceptionPolicy.HandleException(ex, "ReplacePolicy");
Line 45:         

userprincipal.changepassword throws exception


Hi all,

      userprincipal.changepassword(oldpassword, newpassword);

gives error: that is Configuration information could not be read from the domain controller, either because the machine is unavailable, or access has been denied. (Exception from HRESULT: 0x80070547)

but userDirectoryEntry.invoke("ChangePassword", new object[] { oldpassword, newpassword });

      userDirectoryEntry.CommitChanges works fine.

Any one please tell me the reason behind this.

active directory exception unusual behaviour


i have a small problem
i want user names from active directory for an auto completer type of service
the method is always throwing an exception 
"searcher.FindAll()' threw an exception of type 'System.DirectoryServices.DirectoryServicesCOMException' System.DirectoryServices.SearchResultCollection 

"Exception from HRESULT: 0x800AC472"


Am Exporting Data in to Excel File,meanwhile if i open any other Excel file than the excel File on which am exporting data gets opened up Automatically having name Book1.How should i stop these excel file not to get open.In the Error log i get an error message showing " Exception from HRESULT: 0x800AC472" . Need help on these.Thanks in Advance.

WebControls.TableRow throws exception on Add()


I have the following method to strip hidden and user-specified columns from a gridviewrow and return a tablerow. 

    Private Shared Function StripHiddenColumns(ByVal gvRow As GridViewRow, ByVal ColumnsToExclude() As Integer) As TableRow

        Dim row As New TableRow
        Dim i As Integer = 0
            For Each cell As TableCell In gvRow.Cells
                If cell.Visible Then
                    If Not ColumnsToExclude.Contains(i) Then
                    End If
                End If
                i += 1

            Return row
        Catch ex As Exception
            Throw ex
        End Try
    End Function

However, when I run this code and hit the Add method for the TableRow,  I get an InvalidOperationException stating the Collection was modified; enumeration operation may not execute.  I've gotten this exception before, but usually it's because I'm attempting to modify a table that is databound.  This particular one is not, i am creating it.  Can anyone offer any insight? 

Thanks in advance.


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