21

我有一个使用 .NET 4.0 开发的 AJAX-heavy ASP.NET Web 应用程序,使用 TFS 作为我们的源代码控制。我们最近升级了我们的开发工具以专门使用 VS2010 和 TFS 2010,但现在每次签出文件时,我们都会看到 Visual Studio 重新加载所有符号,并且所有会话都被删除。

在放置一些错误日志代码后,我们发现回收的原因是它认为 App_offline.htm 每次我们检查时都会发生变化。这在项目中的任何地方都不存在,我的 SO-fu 找到了一些关于 SQL Express 使这个文件被创建和删除的信息,所以这可能就是这里发生的事情。

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

如果确实发生了这种情况,是否有任何方法可以阻止签出添加/删除此文件?每当我简单地签出一个文件时,让应用程序回收是非常令人沮丧的......

4

3 回答 3

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)

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.

于 2013-06-05T06:43:03.103 回答
1

因为我也有这个问题,所以我决定尝试追踪它。首先,我发现如果我的数据库连接处于脱机状态并单击服务器资源管理器中的刷新按钮,它会在我的网站根目录中创建 app_offline 文件,然后将其删除。我重新制作了好几次。

我实际上在服务器资源管理器中有 3 个数据库连接。如果我断开与远程 SQL 服务器上的数据库的实际连接的 2 个连接,则刷新时它不会生成 app_offline 文件。如果我从本地 .MDF 文件断开连接,然后刷新(它重新连接到该 .mdf 文件并且断开连接的红色 X 消失),它只会生成 app_offline 文件。果然,每次重新连接到该本地数据库后,app_offline.htm 文件都会出现在我的回收站中。

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

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

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

于 2010-12-07T08:11:44.267 回答
0

也许,有人确实签入了文件 app_offline,当你得到项目时,文件就来了。查看您的源存储库。

于 2010-12-02T19:31:18.273 回答