每当我在 TFS 中检出文件时都会创建/删除 App_offline.htm [英] App_offline.htm created/deleted whenever I check out a file in TFS

查看:25
本文介绍了每当我在 TFS 中检出文件时都会创建/删除 App_offline.htm的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

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

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.

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

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

推荐答案

我发现了一个解决方法.

I have discovered a work-around.

1) 转到 Visual Studio 缓存 app_offline.htm 文件的位置C:Users[user]AppDataRoamingMicrosoftVisualStudio11.0(用你的用户名替换 [user])

1) Go to the location in which Visual Studio caches the app_offline.htm file C:Users[user]AppDataRoamingMicrosoftVisualStudio11.0 (replace [user] with your username)

2) 删除 app_offline.htm 文件

2) Delete the app_offline.htm file

(注意:仅此一项并不能解决问题,因为 VS 在找不到文件时会再次重新生成文件)

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

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

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

这实质上会导致尝试使用该文件的进程出错,因为它不是文件,并且名称冲突意味着 VS 无法尝试重新创建该文件.幸运的是,该错误没有任何不必要的副作用.

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.

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

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

这当然意味着任何发布过程都可能不会使用 app_offline.htm 文件,因此您需要密切注意这一点.

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.

这篇关于每当我在 TFS 中检出文件时都会创建/删除 App_offline.htm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆