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

社会主义新天地 提交于 2019-11-28 06:24:10

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.

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.

darkfreq

Maybe, someone do checkin in the file app_offline, when you get the project, the file comes. Look at your source repository.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!