App_offline。每当我检出TFS中的文件时,htm就会创建/删除

时间:2022-02-16 02:02:50

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.

我有一个大量使用ajax的ASP。NET web应用程序使用。NET 4.0开发,使用TFS作为源控件。我们最近升级了我们的开发工具,只使用VS2010和TFS 2010,但是现在每当一个文件被检出,我们就会看到visual studio重新加载所有的符号,所有的会话都被删除。

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.

在输入一些错误的日志代码之后,我们发现了回收的原因是它认为App_offline。我们每次结账时htm都在变化。这在项目的任何地方都不存在,我的so -fu找到了一些关于SQL Express的信息,使这个文件被创建和删除,所以这是可能的。

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

看起来我确实安装了SQL-Express,但即使禁用运行的服务,问题仍然存在。

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

如果确实发生了这种情况,是否有办法阻止签出添加/删除这个文件?当我简单地检出一个文件的时候,让应用程序循环使用是非常令人沮丧的……

4 个解决方案

#1


14  

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)

1)进入Visual Studio缓存app_offline的位置。htm文件C:\用户[用户]\AppData\漫游微软\VisualStudio\11.0\(用用户名替换[用户])

2) Delete the app_offline.htm file

2)删除app_offline。htm文件

(NOTE: this alone will not solve it, as VS regenerates the file again when it's not found)

(注意:这本身并不能解决问题,因为VS在未找到文件时重新生成文件)

3) Create a directory called app_offline.htm (a DIRECTORY!)

3)创建一个名为app_offline的目录。htm(目录)

This essentially causes an error with the process that attempts to use the file because it's not a file and the name * means VS cannot try to recreate the file. Luckily the error has no unwanted side-effects.

这本质上导致进程尝试使用该文件的错误,因为它不是一个文件,名称冲突意味着VS无法尝试重新创建该文件。幸运的是,这个错误没有副作用。

Now continue with using VS and Team Foundation Server and enjoy not constantly having the appdomain reloaded!

现在继续使用VS和Team Foundation Server,并享受不经常重新加载appdomain的乐趣!

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.

这当然意味着任何发布过程都不会使用app_offline。htm文件,所以你需要关注它。

#2


1  

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.

既然我也有这个问题,我决定试着去追踪它。首先,我发现如果我的数据库连接是脱机的,我点击服务器资源管理器中的Refresh按钮,它会在我的网站根目录中创建app_offline文件,然后删除它。我重新制作了好几次。

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.

我实际上在服务器资源管理器中有3个数据库连接。如果断开与远程SQL服务器上的数据库连接的两个连接,则在刷新时不会生成app_offline文件。它只生成app_offline文件,如果我从本地的.mdf文件断开连接,然后刷新(重新连接到.mdf文件,红色断开连接的X就会消失)。可以肯定的是,每次重新连接到本地数据库app_offline之后。htm文件显示在我的回收站中。

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.

更进一步,我分离了本地数据库(。并将文件移动到我的桌面。然后重新启动VS2010,无法重新生成错误。我将文件放回原处,重新建立连接,并开始重新获取app_offline。然后我禁用了SQLExpress服务,并得到了一些其他错误,但是即使禁用了SQLExpress服务,我仍然在回收站中获得了app_offline。

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.

所以,我想我的答案是,如果可以的话,去掉。mdf本地数据库。这对我来说不是一个好的选择,因为我在远程处理代码时需要本地数据库,但是如果您不需要任何本地数据库,也许您可以尝试删除它们。

Note: I'm using VS2010 (and sometimes VS2008) and SQLExpress 2008 RS. I do not use TFS.

注意:我使用的是VS2010(有时是VS2008)和SQLExpress 2008 RS。我不使用TFS。

#3


0  

Seems like the answer is to use Web Application projects, not Web Site projects.

似乎答案是使用Web应用程序项目,而不是Web站点项目。

stopping app_offline.htm from being created and deleted at each build?

停止app_offline。htm不会在每次构建中被创建和删除?

Why does app_offline.htm keep appearing in my web project?

为什么app_offline。htm一直出现在我的web项目中?

#4


0  

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

可能,有人在文件app_offline中进行签入,当您获得项目时,文件就会出现。查看源存储库。

#1


14  

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)

1)进入Visual Studio缓存app_offline的位置。htm文件C:\用户[用户]\AppData\漫游微软\VisualStudio\11.0\(用用户名替换[用户])

2) Delete the app_offline.htm file

2)删除app_offline。htm文件

(NOTE: this alone will not solve it, as VS regenerates the file again when it's not found)

(注意:这本身并不能解决问题,因为VS在未找到文件时重新生成文件)

3) Create a directory called app_offline.htm (a DIRECTORY!)

3)创建一个名为app_offline的目录。htm(目录)

This essentially causes an error with the process that attempts to use the file because it's not a file and the name * means VS cannot try to recreate the file. Luckily the error has no unwanted side-effects.

这本质上导致进程尝试使用该文件的错误,因为它不是一个文件,名称冲突意味着VS无法尝试重新创建该文件。幸运的是,这个错误没有副作用。

Now continue with using VS and Team Foundation Server and enjoy not constantly having the appdomain reloaded!

现在继续使用VS和Team Foundation Server,并享受不经常重新加载appdomain的乐趣!

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.

这当然意味着任何发布过程都不会使用app_offline。htm文件,所以你需要关注它。

#2


1  

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.

既然我也有这个问题,我决定试着去追踪它。首先,我发现如果我的数据库连接是脱机的,我点击服务器资源管理器中的Refresh按钮,它会在我的网站根目录中创建app_offline文件,然后删除它。我重新制作了好几次。

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.

我实际上在服务器资源管理器中有3个数据库连接。如果断开与远程SQL服务器上的数据库连接的两个连接,则在刷新时不会生成app_offline文件。它只生成app_offline文件,如果我从本地的.mdf文件断开连接,然后刷新(重新连接到.mdf文件,红色断开连接的X就会消失)。可以肯定的是,每次重新连接到本地数据库app_offline之后。htm文件显示在我的回收站中。

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.

更进一步,我分离了本地数据库(。并将文件移动到我的桌面。然后重新启动VS2010,无法重新生成错误。我将文件放回原处,重新建立连接,并开始重新获取app_offline。然后我禁用了SQLExpress服务,并得到了一些其他错误,但是即使禁用了SQLExpress服务,我仍然在回收站中获得了app_offline。

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.

所以,我想我的答案是,如果可以的话,去掉。mdf本地数据库。这对我来说不是一个好的选择,因为我在远程处理代码时需要本地数据库,但是如果您不需要任何本地数据库,也许您可以尝试删除它们。

Note: I'm using VS2010 (and sometimes VS2008) and SQLExpress 2008 RS. I do not use TFS.

注意:我使用的是VS2010(有时是VS2008)和SQLExpress 2008 RS。我不使用TFS。

#3


0  

Seems like the answer is to use Web Application projects, not Web Site projects.

似乎答案是使用Web应用程序项目,而不是Web站点项目。

stopping app_offline.htm from being created and deleted at each build?

停止app_offline。htm不会在每次构建中被创建和删除?

Why does app_offline.htm keep appearing in my web project?

为什么app_offline。htm一直出现在我的web项目中?

#4


0  

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

可能,有人在文件app_offline中进行签入,当您获得项目时,文件就会出现。查看源存储库。