stopping app_offline.htm from being created and de

2019-02-16 19:50发布

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

7条回答
时光不老,我们不散
2楼-- · 2019-02-16 20:28

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

查看更多
Bombasti
3楼-- · 2019-02-16 20:28

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

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

查看更多
劳资没心,怎么记你
4楼-- · 2019-02-16 20:34

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!

查看更多
放荡不羁爱自由
5楼-- · 2019-02-16 20:35

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.

查看更多
男人必须洒脱
6楼-- · 2019-02-16 20:35

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

The answer here with another possible workaround here.

查看更多
对你真心纯属浪费
7楼-- · 2019-02-16 20:42

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.

查看更多
登录 后发表回答