I have an AJAX-heavy ASP.NET web application developed using .NET 4.0, using TFS as our source control. We recently upgraded our dev tools to use VS2010 and TFS 2010 exclusi
Since I have the problem as well I decided to try and track it down. First I figured out that if my database connections are offline and I click the Refresh button in the Server Explorer, it creates the app_offline file in the root of my website, and then deletes it. I re-produced it several times.
I actually have 3 database connections in the server explorer. If I disconnect the 2 connections that are actually connections to a database on a remote SQL server, it does not produce the app_offline file when I refresh. It ONLY produces the app_offline file if I disconnect from a LOCAL .MDF file, and then refresh (which re-connects to that .mdf file and the red disconnected X goes away). Sure enough, after every re-connect to that local database, the app_offline.htm file shows up in my Recycle Bin.
Taking it a step further, I detached the local database (.mdf file) and moved the file to my desktop. Then re-started VS2010 and could no re-produce the error. I put the files back, re-established the connection, and started getting the app_offline again. Then I disabled the SQLExpress service, and did get some other errors, but even with the SQLExpress service disabled, I still got the app_offline in my Recycle Bin.
So, I guess my answer is to get rid of .mdf local databases if you can. It's not a good option for me because I need that local database when I'm working on code remotely, but if you don't need any local databases, maybe you could try removing them.
Note: I'm using VS2010 (and sometimes VS2008) and SQLExpress 2008 RS. I do not use TFS.
Maybe, someone do checkin in the file app_offline, when you get the project, the file comes. Look at your source repository.
I have discovered a work-around.
1) Go to the location in which Visual Studio caches the app_offline.htm file C:\Users[user]\AppData\Roaming\Microsoft\VisualStudio\11.0\ (replace [user] with your username)
2) Delete the app_offline.htm file
(NOTE: this alone will not solve it, as VS regenerates the file again when it's not found)
3) Create a directory called app_offline.htm (a DIRECTORY!)
This essentially causes an error with the process that attempts to use the file because it's not a file and the name clash means VS cannot try to recreate the file. Luckily the error has no unwanted side-effects.
Now continue with using VS and Team Foundation Server and enjoy not constantly having the appdomain reloaded!
This does of course means that any Publish process will probably not use the app_offline.htm file, so you'll need to keep an eye on that.