TFS 2012 Visual Studio插件可立即创建和删除"app_offline.htm"每当文件签出导致ASP.NET AppDomain回收时 [英] TFS 2012 Visual Studio plug-in instantly creates and deletes "app_offline.htm" whenever a file is checked out causing the ASP.NET AppDomain to recycle

查看:157
本文介绍了TFS 2012 Visual Studio插件可立即创建和删除"app_offline.htm"每当文件签出导致ASP.NET AppDomain回收时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Visual Studio 2012有问题,这使我发疯.我们正在开发一个ASP.NET Web应用程序,并且在应用程序启动时必须将很多内容加载到内存中.有时可能需要20到30个小时才能启动并准备好处理第一个http请求.

I have a problem with Visual Studio 2012 which is driving me crazy. We're developing an ASP.NET web app and on app start up it has to load a lot of stuff into memory. It sometimes takes between 20-30 for it to start up and be ready to server the first http requests.

我们使用的是TFS源代码控制,基本上,每次有人编辑文件时,TFS都会将该文件标记为已签出"(红色的小勾号出现在解决方案资源管理器"中的文件名图标旁边),并立即创建并删除Web应用程序根目录中的"app_offline.htm"文件.

We're using TFS source control and basically, every times someone edits a file, TFS marks the file as "checked out" (the little red check mark appears next to the filename icon in the Solution Explorer) AND instantly creates and deletes a "app_offline.htm" file in the root of the web app.

这将导致Web应用程序卸载.我使用登录Application_Start和Application_End事件来发现这一点.然后,我使用SysInternals Process Monitor查看正在发生的活动.当我看到procmon的加密输出中提到app_offline.htm时,我使用了一个单独的名为Directory Monitor的文件系统监视程序,它确认app_offline.htm确实已创建并被立即删除.

This causes the Web Application to unload. I used logging in the Application_Start and Application_End events to find this out. Then I used SysInternals Process Monitor to see what activity was happening. When I saw app_offline.htm being mentioned within the cryptic output of procmon, I used a separate File System Watcher called Directory Monitor which confirmed that the app_offline.htm was indeed being created and instantly deleted.

此功能的连锁效应是,如果您需要进行一些更改,则应用程序在开发过程中必须多次卸载/重新加载.这是浪费时间.

The knock-on effect of this is that if you have a few changes to make, the app has to unload/reload many many times during development. This is wasting hours.

不仅如此,不断重新加载应用程序域会导致IIS最终耗尽内存,然后我们必须执行IISRESET.

Not only that, the constantly reloading of the app domain causes IIS to eventually run out of memory and then we have to do an IISRESET.

有人知道TFS为什么创建此文件吗?以及是否有任何方法可以阻止它?

Does anyone know why TFS creates this file? And whether there is any way to get it to stop?

推荐答案

我发现了一种解决方法.

I have discovered a work-around.

1)转到Visual Studio缓存app_offline.htm文件的位置 C:\ Users [用户] \ AppData \ Roaming \ Microsoft \ VisualStudio \ 11.0 \(用您的用户名替换[user])

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)删除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,并享受不必不断重新加载appdomain的乐趣!

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

这篇关于TFS 2012 Visual Studio插件可立即创建和删除"app_offline.htm"每当文件签出导致ASP.NET AppDomain回收时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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