How to Fix 'Timeout expired. The timeout period elapsed prior to completions of the operation'

by Updated January 28, 2011

On a number of a occassions I've run into the following ASP.NET / IIS7 error after uploading my newly built Visual Studio.net web project site into IIS (where the site had previously been working fine):

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


The site would be running perfectly on my local computer, but once uploaded to my production server I would get the SQLException Timeout expired error.  While this Timeout expired error can happen due to any number of reasons, I've found that sites, which had been working fine until uploaded a new build of the site to IIS7, that the reason I would get this error was because something was wrong with the "Build" version of the Visual Studio.net web Project and/or Solution files.  So essentially I found that I just needed to run the Project/Solution through a "Rebuild" using Visual Studio.net (not just a "Build").

For whatever reason, it seems like something occassionally will get corrupted on regular "Build" of the VS.net web Project and/or Solution file.  So if I just do a "Build" and upload the new project .zip file to my server and import it into IIS7, it won't correct the problem.

However, if I do a "Rebuild" of the Visual Studio.net Project and Solution and then import the project .zip file into IIS7, the 'Timeout expired' error goes away. 

I've encountered this issue at least twice now, and at first it was somewhat daunting not knowing what exactly was causing the Timeout expired error. But after doing a "Rebuild" of my Visual Studio.net web project I've been able to get my sites up and running.

Lastly, make sure that you rebuild the project in Release mode (not Debug).

So I'm sure this tip won't help everyone to figure out what is causing your exact "Timeout expired" SqlException error, but hopefully the solution I provided above will come in handy for some of you who are experiencing the same sort of issues as I have.

 

 


0
0

Add your comment

by Anonymous - Already have an account? Login now!
Your Name:

Comment:
Enter the text you see in the image below
What do you see?
Can't read the image? View a new one.
Your comment will appear after being approved.

Related Posts


So yesterday, I started getting green squiggly line validation warnings at design time on ASP.NET server controls within the HTML Design view for my Visual Web Developer 2010 Express project in Windows 7. Essentially, intellisense on all the ASP.NET...  more »

After setting up a new Windows 7 computer with IIS 7.5 and Visual Studio 2010, I tried to start my ASP.NET 4.0 website using the Local IIS web server. However, right off the bat I was hit with the following IIS error message: HTTP Error 500.21 - Internal...  more »

When developing websites or applications in Visual Studio.NET, you sometimes need to have Visual Studio run as an administrator. For instance, if you are developing a Web Application Project that uses IIS7 as the local development server for testing,...  more »

After running a ASP.NET website on IIS 7.5 for the first time on a Windows 7 computer, I was faced with the following error message: Login failed for user 'IIS APPPOOL\ASP.NET v4.0'. Description: An unhandled exception occurred during the execution of the...  more »

While using my new Windows 7 64-bit computer, with Visual Studio 2010 running as Administrator, I began getting the following error while trying to open up individual c# files or asp.net files in VS2010: "There was a problem sending the command to the...  more »