asp.netvisual-studio-2010app-offline.htm

App_offline.htm created/deleted whenever I check out a file in TFS


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 exclusively, but now every time a file is checked out, we see visual studio reloading all the symbols, and all the sessions being dropped.

After putting some error logging code, we discovered the reason for the recycle is it reckons App_offline.htm is changing whenever we check out. This doesn't exist anywhere in the project, and my SO-fu has found some information about SQL Express making this file get created and deleted, so it's possible that's what's happening here.

It looks like I do have SQL-Express installed, but even disabling the services that are running, the problem persists.

Is there any way to stop a check out from adding/removing this file, if this is indeed what is happening? It's beyond frustrating to have the app recycle whenever I simply check out a file...


Solution

  • 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.