阻止 app_offline.htm 在每次构建时创建和删除?

发布于 2024-07-13 17:10:23 字数 922 浏览 9 评论 0原文

我有一个包含 Visual Studio 2008 SP1、.NET Framework 3.5 SP1 中的 2 个项目的解决方案。

  • 一个 ASP 网站。
  • 类库 (dll) 项目。

我有从网站到类库的引用,因为类库是我的数据层。 但无论如何,只有在这种基本设置、具有这两种类型的项目的解决方案以及从网站到类库的引用的情况下,才会发生这种情况。

现在,每次我修改类库中的某些内容并构建它时,Visual Studio 都会创建一个名为 app_offline.htm 的文件,然后将其删除(它将其发送到回收站)。

这真的很烦人,因为一天结束时我会得到一个完整的回收站,而我,作为完美主义者,我想保持它干净。 我不是唯一遇到此问题的人:此处此处

我现在知道问题的原因,但仍然不知道如何解决。 如果您之前没有听说过 app_offline.htm,这里是 ScottGu 的关于app_offline的文章

有人知道这个问题的解决方案吗? VS 中的某些设置可以在构建过程后永久删除该文件? (我真的不想设置回收站来执行此操作,因为我有时会无意中删除一些内容,并且我希望能够恢复这些内容。)

I have a solution with 2 projects in Visual Studio 2008 SP1, .NET Framework 3.5 SP1.

  • a ASP Web site.
  • a Class Library (dll) project.

I have a reference from the Web Site to the Class Library, as the Class Library is my data layer. But anyway, the thing happens only with this basic setup, a solution with these 2 types of projects and a reference from the Web Site to the Class Library.

Now, each time I modify something in the Class Library and I build it, Visual Studio creates a file called app_offline.htm and then deletes it (it sends it to the Recycle Bin).

This is really annoying because at the end of the day I end up with a full Recycle Bin and me, being the perfectionist I am, I want to keep it clean. I'm not the only one with this problem: here and here.

I know now the cause of the problem, but still not how to fix it. If you didn't hear about app_offline.htm before, here's ScottGu's article on app_offline.:

Does anyone know a solution to the problem? Some setting in VS to delete the file forever after the Build process? (I really don't want to set my Recycle Bin to do that, as I do delete things unintentionally from time to time and I'd like to be able to recover those.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

勿忘初心 2024-07-20 17:10:23

该文件不会进入我的回收站。 也许您安装了一些严格的实用程序,它们可以执行此操作? 许多防病毒工具和通用系统实用程序套件早在 2000 年就曾这样做过,但我没有使用更高版本的经验。

更新:您可以使用进程监视器来找出哪个进程移动了这个文件到回收站。

This file does not go into the Recycle Bin for me. Perhaps you have some draconian utilities installed, which do this? Many anti-virus tools and general system utility suites used to do this back in 2000 but I do not have experience with later versions.

Update: You can use Process monitor to find out which process moves this file to the recycle bin.

情何以堪。 2024-07-20 17:10:23

[免责声明:我添加一个答案首先是因为我希望它能让更多人看到这个问题(我承认),其次是因为我对答案没有字符数限制,而不是评论。]

我遵循了桑德的建议并使用进程监视器来跟踪哪个进程将此文件移动到回收站。

确实是devenv.exe。

它在多个事件中执行操作,例如:QueryDirectory、QueryOpen、CreateFile 和 CloseFile。 devenv.exe 是唯一与 app_offline.htm 有关的进程

...我怎样才能让 Visual Studio 停止归档我的回收站? (丹,干得好,在“答案”中提出了一个问题(:)

[Disclaimer: I'm adding an answer firstly because I hope it will get the question seen by more people (I admit it) and secondly because I have no characters limit on an answer, as oposed to a comment.]

I followed Sander's suggestion and used Process Monitor to track which process moves this file to the Recycle Bin.

It was indeed devenv.exe.

There are several events where it makes operations like: QueryDirectory, QueryOpen, CreateFile and CloseFile. And devenv.exe is the only process that has anything to do with app_offline.htm

Still... How could I make Visual Studio stop filing up my Recycle Bin? (way to go, Dan, putting a question in the 'answer' (: )

贪恋 2024-07-20 17:10:23

在我们遇到 VSTS 服务器问题后不久,我就开始看到同样的问题。 VSTS 服务器宕机了一天,所以我不得不以离线模式打开解决方案。 VSTS 服务器重新上线后,我必须在源代码控制下重新打开解决方案,并且每次重新编译 Web 项目时,app_offline.htm 文件都会开始不间断地出现。

这真的很烦人!

I started seeing the same problem shortly after we suffered a VSTS server problem. The VSTS server went down for a day so I had to open the solution in offline mode. After the VSTS server came back online, I had to reopen the solution under source control, and the app_offline.htm files start occurring non-stop every time I recompile my web projects.

THIS IS REALLY ANNOYING!

╰沐子 2024-07-20 17:10:23

我还不知道如何阻止它,但我知道如何在我的环境中可靠地重现问题:

Windows XP Pro、VS2008、SourceGear(源代码控制系统)。

每当我执行结帐时,都会立即在根文件夹中创建和删除 app_offline.htm 文件。 源代码控制系统正在使用 SQL Enterprise,因此我不确定它是否与人们发布的有关 SQL Express 的帖子中的一些参考文献有关。

同样,仍然不知道如何停止它,但这也许会帮助其他人弄清楚文件是如何/何时生成和删除的。

I am not sure how to stop it yet, but I know how to reliably recreate the problem on my environment:

Windows XP Pro, VS2008, SourceGear (Source Control System).

Whenever I perform a checkout, the app_offline.htm file is instantly created and deleted in/from the root folder. The source control system is using SQL Enterprise, so I am not sure it is related to some references from posts people are making about SQL Express.

Again, still don't know how to stop it, but maybe this will help other figure out how/when the file is generated and deleted.

简单 2024-07-20 17:10:23

使用 Web 应用程序项目,而不是网站模板,这些模板是为“傻瓜”准备的。 :)

Use Web Application projects, not the Web Site templates, those are for 'dummies'. :)

今天小雨转甜 2024-07-20 17:10:23

我遇到这个问题是因为我从开发计算机直接发布到 Azure Web 服务。

答案此处以及另一种可能的解决方法此处

I had this problem because I published directly to Azure Web Service from the dev machine.

The answer here with another possible workaround here.

ぃ弥猫深巷。 2024-07-20 17:10:23

这就是我能找到的关于这个主题的全部内容。 不幸的是,这也是猜测。

http://petermcg.wordpress.com/2008/05/12 /silverlight-app-offline/

This is all I could find on the subject. Unfortunately it's also speculation.

http://petermcg.wordpress.com/2008/05/12/silverlight-app-offline/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文