stopping app_offline.htm from being created and deleted at each build?

你离开我真会死。 提交于 2019-12-01 01:03:01

问题


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


回答1:


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.




回答2:


[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' (: )




回答3:


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!




回答4:


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.




回答5:


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




回答6:


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:


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

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



来源:https://stackoverflow.com/questions/565798/stopping-app-offline-htm-from-being-created-and-deleted-at-each-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!