This application is currently offline. To enable the application, remove the app_offline.htm file from the application root directory.

By removing that file, it works

but why does itgets created automatically?

Dani AI

Generated

What you are seeing is expected behavior from ASP.NET, not the framework mysteriously creating files. app_offline.htm is a switch ASP.NET watches for. Tools like Visual Studio Publish and Web Deploy will drop that file into your site root to take the app offline while they copy binaries, then remove it when they finish. If a publish is interrupted or you publish straight into the folder you are running from, the cleanup can fail and the file gets left behind. Deleting it brings the site back online, which matches what described. See Microsoft’s guidance on taking apps offline during deploy and how Web Deploy automates it: Deploying a code update and Taking web apps offline with Web Deploy.

Why it seems random to : common triggers are (a) publishing to the same folder you are debugging from, (b) a VS extension or source control plug-in briefly taking the app offline, or (c) a previous publish that crashed. To confirm who is doing it, run Process Monitor and filter on Path ends with app_offline.htm; it will show the exact process writing the file: Process Monitor (Sysinternals).

How to stop it, : turn off the offline step in your publish profile or publish to a separate staging folder and then copy to IIS. In Properties/PublishProfiles/YourProfile.pubxml set:

<Project>
  <PropertyGroup>
    <EnableMSDeployAppOffline>false</EnableMSDeployAppOffline>
  </PropertyGroup>
</Project>

You can also manage this via newer VS publish UI. More details here: .NET blog: app offline support and Editing .pubxml settings.

Note: this behavior is an ASP.NET deployment feature; it is not caused by SQL Server Express.

Recommended Answers

All 11 Replies

It doesn't as far as I know. Are you deploying it with your application or is something creating it?

I am using VS 2008. I am developing a website in it. So while creating pages and running them to test it works fine but on running my website ..sometimes ..it says
"This application is currently offline. To enable the application, remove the app_offline.htm file from the application root directory"

So when i browse my project , I see app_offline.htm page. I just delete it and all goes well then...
It happens very rarely to someone or may not happen also... its very rare.. but ya it does get created..

In your case its possible that you havnt came across such situation...but ya I have..so it puzzles me:)
so I am asking here
any help??:)

I get this same problem ( though using VS2010 beta 2) every now and again (twice this week) something creates the app_offline.htm file in the root dir of the site I'm working on.

Ok its easy fixed, just delete the file. However where is this file coming from, what's creating it? I know I'm not.? :S

Is there any setting to disable the 'automatically create the app_offline.htm'?
what a bother...

This is the first I've heard of this, but stackoverflow says it happens when you use the publish utility within Visual Studio. I have no idea if that's true or not.

http://stackoverflow.com/questions/2148125/why-does-app-offline-htm-keep-appearing-in-my-web-project

From a link off that link, there's also this blurb

"SQL Server 2005 express edition does not support multiple processes. Only single process can access database at a time. So when a database is accessed through visual studio, ASP.net runtime cannot access the database. This will result into the internal server error. To prevent this, VS 2005 places app_offline.htm file in the application's root directory. The file contain above message. This causes ASP.net to put the application in offline mode. Please note the accessing database means opening any component of the database (I.e. table, view, stored procedure etc.) into the design window. When design window is closed, VS 2005 removes app_offline.htm file making the application in onliner mode again."

http://www.codeproject.com/KB/aspnet/app_offline.aspx

So it could also be that files are getting moved to the server while a design window is open against SQL Server 2005 Express. And, who really knows, there could be multiple things that trigger the creation of that file. I've never seen it, though.

is that so?? i see it now...
so there is no way to avoid it happens then..
fyi, i have deleted it many times, n when i saw my recycle bin, there r HUNDREDS file of app_offline.htm in there! :D
btw thanks 4 da info!

Hi Guys,
I too get the same problem. But when i restore my system it is getting created. I deleted it then i didn't get again.

Vijay Reddy Chennadi
www.chennadi.blogspot.com

I got the problem and tried to find on web but could not find the exact solution. It does not happen every time ! Please do rep if anybody have!

I got app_online.htm problem after deploying my website.I removed from websites folder of visual studio file.The problem got solved.:icon_smile:

if you r usingSQL Server express edition does not support multiple processes. Only single process can access database at a time. So when a database is accessed through visual studio, ASP.net runtime cannot access the database. This will result into the internal server error. To prevent this, VS 2005 places app_offline.htm file in the application's root directory. The file contain above message. This causes ASP.net to put the application in offline mode. Please note the accessing database means opening any component of the database (I.e. table, view, stored procedure etc.) into the design window. When design window is closed, VS 2005 removes app_offline.htm file making the application in onliner mode again.

This application is currently offline. To enable the application, remove the app_offline.htm file from the application root directory.
pls rectify my error .. i can't find this error

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.