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

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

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.

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

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!

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.

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

I had this problem because I published directly to Azure Web Service from the dev machine.
The answer here with another possible workaround here.

This is all I could find on the subject. Unfortunately it's also speculation.
http://petermcg.wordpress.com/2008/05/12/silverlight-app-offline/

Related

ASP Project on Visual Studio bad performance while debuging

I have a ASP Project running Visual Studio 2013 having very bad Performance while debuging/running the Project. The same Project running on a normal IIS Server is super fast with no Problems. Other Projects are running also super fast with no Problems (also on VS2013).
I have already tryed the following:
Delete All Breakpoints does nothing.
Debug or Release version, doesn't matter.
start without Debugging has the same problem.
Putting my project on a full IIS implementation on a web server runs it super fast with no problems.
Clean Solution, or deleting the .suo also do nothing
comment all the CodeBehind and the JavaScript
the solution with symbol loading from Visual Studio debugging/loading very slow also dont work.
Another often mentioned solution is to deactivate Intellitrace, but I don't found how to do that in VS2013 (the Intellitrace MenuItem in the Tools/Options Menu is missing)
There are many empty ScriptDocuments created while running, dont know if that has anything to do with the Problem.
Thanks for any Ideas!
This may sound strange, I had the same problem and tried all suggestions I found on the internet. The cause for me was I has a blank DVD in my drive. I found this by looking at where Visual Studio was trying to load the symbols from "my d drive (dvd)". After I ejected the blank DVD it was back to normal. This was very strange but just saying, check where VS is trying to load the symbols from in the output window. Hope this save someone from running round in circles.

DotNetNuke Module keeps converting itself into Application in IIS7

Bit of a weird one. For some reason one of my DNN modules keeps being converted into an Application in IIS7 in my development environment. Meaning when I try to view a page that contains that module it can't find the module correctly. It's ok if I go into IIS and delete the application, then restart the site but is a bit of a pain and am little worried it might do this when uploaded to the live server and disable the whole site.
Anyone encountered anything like this before? Any thoughts?
This is a common problem with my VS templates, though not for everyone, and it doesn't happen all the time. It stems from Visual Studio, so it shouldn't ever be a problem on your production servers, unless you upload source and try to compile there, than it might be an issue.
HuwD,
A good resource might be my module template installation video which gives good information on setting up your development environment and debugging issues (regardless of the template you use). Check out between 1:30 and 5:00 minutes for the environment setup, and after 19 minutes some of the troubleshooting.
A couple common problems I see Visual Studio doing is creating an unwanted virtual directory on the DesktopModules folder and/or creating an unwanted web.config in the module's root.
Another good resource is Dnnhero.com. In the development section there is a series on DNN7 environment and template setup.
You may want to give a try a free module called Users Importer - A bit old but worth a try.
Here is a paid alternative: Bulk User Manager

Problem with built assembly not matching source when debugging under IIS 7.5

I have a problem debugging a web forms application that is configured to use IIS for debugging, under Windows 7 and Visual Studio 2010. An example has just occurred, where I make a change to the code behind for a web form, save, and apparently rebuild before starting the app using F5.
The app starts, and I get an error message trying to do something in the app. I tell the debugger to break when an exception is thrown and try my task again, only to be told
The source file is different from when the module was built.
where the module is C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\9d7b45ca\11a98b19\assembly\dl3\5e6cf0b2\636409d4_dfeecb01\PerfixEMS_Admin.DLL
The physical folder for my test web site is set to the web application project's source folder, so I have always assumed that IIS will look in the bin folder for required assemblies, and these will be rebuilt as expected. Why is this not happening?
Cleaning the solution usually works for me.
Update
Given the high number (320) of projects I understand why Clean and Build won't work for you. You should however try it at least once to see if fixes things.
If it does fix your problem but doesn't last you'll need to do one of two things.
Clean just the one file
Delete the offending temp file. You probably won't be able to do this because with VS running since it may have a lock on the DLL. You may also have to stop IIS. You can use Process Explorer to look for the processes that have a lock.
Use a custom solution
Its unlikely that you're going to be modifing all 320 projects at the same time. Create a custom solution for just the projects you're working on. You'll still be able to step through any project you have the DLL and PDB for if you need to.
Which to do
Using a custom solution has its problems since you can no longer use project reference for projects not in your solution. This impacts your team's source control. You'll also have to make sure the DLL's and PDB's from outside your solution are in a stable location and you'll need a way to detect when thoes other projects have changes that you care about.
These problems can be overcome with a careful check-in process for Project changes and scripts that copy files and working with team members to figure out how to communicate changes.
On the other hand closing VS for every change or running Clean and build isn't really tennable either.
it may be a workaround, but I just need to see if it will work or not, then we may investigate more in the original case. but for now, try this:
1- publish this website to a different folder
2- open the newly published version from your preferred browser (ex: http://localhost/APP_NAME).
3- from VS, open "Debug" menu, choose "Attach to process..."
4- select the IIS worker process "w3wp.exe" and click "Attach".
(if you can't find it, make sure that the checkbox "show processes in all sessions" is checked)
5- start debugging your source code normally and let me know what happened, thanks.

Convert File System Website to IIS Website

We recently migrated from VS 2008 to VS 2010. The migration went fine, except for our web project. Before, in VS 2008, the site showed up as http://localhost/Website. Now, it appears as C:...\Website. It appears that when we did the migration, VS started to treat it as a file system website.
I've tried removing the existing site and re-adding it as an existing website, but it still displays it as C:...\Website. Is there any way to convert it back to show it as a http://localhost/website, and run through IIS, as opposed to the default ASP.NET Development Server?
Special thanks to John Dundon at Microsoft for helping me resolve the issue. Here's what he said:
Thanks for all the details. This actually sounds like a quirky behavior
in VS that I think I can help you work
around.
I believe the reason it’s remembering
to use the local development server is
because it got stored in the SUO file.
So there are two possible ways to fix
this:
Re-open your solution from source control as an administrator on the
machine with IIS installed and
everything should get downloaded to
its right place
If you close VS, delete the SUO file (note – this will erase some
settings about the state of your
solution but shouldn’t cause any real
data loss), and then re-open the
solution, it should ask you to
re-download that particular web site
and will try to make it an IIS web
site again.
Note however though that since your
virtual directory already exists on
your machine, it’s going to ask you if
you want to use it – I’m assuming you
do, but it will overwrite any files
when it does.
Let me know if this works for you (and
while you technically shouldn’t need
to, it may be a good idea to back up
any work you’ve done in this
enlistment that hasn’t been checked in
prior to trying this).
I followed his advice and removed my SUO file and re-opened the solution. The website was automatically fixed as http://localhost/Website and it also checked out the .SLN file as well, and when I checked it in, it fixed the issue for other developers as well. Hope this solution helps out others as well with this quirky issue.
Look in the project properties, on the Web tab. You'll be able to select whether to use IIS or the development server, and which virtual directory to use.

ASP.NET Development Webserver Instantly Crashing for Seemingly No Reason

Working on an ASP.NET Project (not Web Site) and trying to Start without Debugging from Visual Studio.
First this:
alt text http://uploadimages.epiforge.com/Crash.png
Then this:
alt text http://uploadimages.epiforge.com/Burn.png
Once completely reinstalled Microsoft Visual Studio 2008 and it was fixed... for a while.
Looking for any information I can find, including:
What in the Hell is going on?
What way is there to fix it other than completely reinstalling VS2008?
How can it just be fixed permanently?
Try this - shouldn't take more than a minute or two.
Create a brand-spanking-new, empty Web Application Project. Enter something like "hello world" on the default.aspx page. Run it.
If your problem disappears, you've got something (3rd party DLL, etc) referenced in your project causing the issue.
Else, your looking at an OS, IDE or other environmental issue. I've had some odd VS issues in the past on Win7 that were solved by available updates. I still have to run VS as an administrator to use the "attach to process" for debugging.
update
So, the new project works, which tells us that the problem is somewhere in your old project. This is where the fun part starts, which is what I like to call "binary search debugging." It's crude, a pain in the ass, and if your app is pretty complex, sorting out dependencies can be a pain in the ass.
Create a new project and add all of your source to it.
Build, run. Did it work?
No? Remove half of the source.
Build. run. Did it work?
If so, the problem is in the half that you removed.
Else, it's in the half that remains.
Now, I know this is an incredibly naive approach to debugging, and its very brute-force, and some app configurations can make this damn near impossible, but at least its straightforward.
Any other service listening to the port number you're using? Try changing the port number or use IIS instead of running it on cassini.

Resources