views:

1380

answers:

7

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

+2  A: 

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.

Sander
I don't have anything too odd on my computer.I even made a test and closed my anti-virus, then tried a build. The file still gets created and sent to the RB.I should add that I did some research before posting the question. I've seen other people with the same problem, but still no answer...
Update: So, i used Process Monitor, thanks for the suggestion. It is really Visual Studio doing it. I detailed it in an answer.
A: 

If you do shift+delete, that deletes a file without it moving to the recycle bin.

But you shouldn't need to delete it. It will get rid of itself one you've built.

IainMH
I'm not doing it manually, Visual Studio automatically creates this file and then sends it to the Recycle Bin each time I do a build.
Is it a post build step that someone has set up? Doesn't happen on my machine.
IainMH
I should also say welcome to SO!
IainMH
Thanks for the welcome :)I managed to recreate the problem with a newly made project, and I explained when the problem appears in the update to my question.
+1  A: 

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

+1  A: 

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!

A: 

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

leppie
A: 

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

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

onedozenbagels
-1: So why bother to answer after all this time?
John Saunders
My recycle bin is also being filled up with app_offline.htm files. I was curious as to why this is happening and stumbled across this question. I also came across the above link. Since there still isn't a good answer as to what is causing this or why I decided to add what I had found to the discussion. Maybe it will help someone figure out what is happening.
onedozenbagels
+1  A: 

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.

William