app_offline.htm doesn't bring the site down - azure

I have an Umbraco website on my Azure app service and it is working fine. I want to bring the site down nicely to do some maintenance so I've added created an "app_offline.htm" file and when I put it on the root of my website locally (on my machine IIS 10, windows 10) it immediately shut downs the website.
But when I copy the file to the root directory of my website on app service (D:\home\site\wwwroot> using KUDU) it doesn't do anything.
What should I do?

The answer for the next person who faces this problem
Ok, I've restarted my app service and it made the app_offline work fine as evilSnobu mentioned in the comment.
Also, recycling the app should work. I've changed my webconfig (added one space somewhere ) and the app_offline started to do its job! :)

Related

My iis automatically points my solution directory though it's published

I have published my IIS application to C:/inetpub/wwwroot/appDirectory and it's have different configuration in web.config file.
and in development version solution directory i have another web.config file and When i build solution my IIS start pointing to solution directory.
that's too annoying, every time i need to remove application from iis and again make application on IIS itself.
Go to properties of your web service in Visual Studio.
Navigate to Web tab
Either Change the local IIS to express or you can give a different application name so it wont replace your deployed application.

"The file was not precompiled and could not be requested" all of a sudden

We are running several WebForms-Application on a Web Hoster (classic IIS, no Azure, no Docker, etc). For some months now, ca. once a month, one or more of these (virtual) applications stop working all of a sudden. In the Application Log Files there is an HttpException: "The file ....aspx was not precompiled and could not be requested." After redeploying (republishing) the application everything is working fine until next month. The Hoster did not find anything inside his log files.
What could be the problem? Where to start search?
Make sure that you used Release Mode, it is always recommended that you publish website in Release Mode

How to restart a dnx website in production?

I updated a ASP.NET CORE/ASP.NET 5 RC1 controller cs file with a programming change.
The site has previously been deployed on production on IIS7.5 Windows 2012 Server which makes use of HTTPPlatformHandler installed in IIS.
This is a remote server I have to access via VPN.
The site is setup as an application in IIS and the folder points to the wwwroot directory of the deployed site.
I deploy it currently by deploying it first locally by right clicking on my project in Visual Studio 2015 and selecting publish to local folder. I then copy the contents of the local folder to the remote network IIS7.5 web server site folder.
If I copy for example the appsettings.json or a changed .cs file to the server, the change will not reflect.
If I copy the whole site to the production server I get folders and files in use messages. I have to kill the 'dnx' process in order to copy without getting these messages.
From my understanding if I kill the process dnx it will force a recompile. This is currently the only way I know of to restart the site after updating it but I imagine it is not the best way.
What is the standard practice to restart your website after you update your production sites that run ASP.NET5 RC1?
Also changing my app.settings json file aslo doesn't trigger a site reload like changing the web.config did in ASP.NET 4 so being able to restart a site is important.
If I have multiple sites on the same app pool and I only want to update one in production. How can I only restart the one site to reflect the latest changes?
Is it possibly to restart the website to reflect the change as updating it directly doesn't cause a recompile taking into consideration if I only have access to a shared folder and not the web server itself?
With IISPlatformHandler, DNX process is started by IIS (instructions are in wwwroot\web.config).
IIS knows nothing about your source files, all requests are forwarded to DNX.
DNX does NOT watch source files for changes, because there is no dnx-watch there.
IIS only watches for wwwroot\web.config file changes, so you need to change/edit/touch it to force IIS to restart website (and DNX process).
I use msdeploy to deploy, it has commands to stop and start app pools, using these commands has resolved my file in use errors. There are lots of ways to use msdeploy, below is how I happen to be using it.
msdeploy -verb:sync -source:recycleApp -dest:recycleApp="site/pool",recycleMode="StopAppPool",computername=COMPUTERNAME
msdeploy -source:contentPath='SOURCE PATH' -dest:contentPath='\\COMPUTERNAME\wwwroot\' -verb:sync -retryAttempts:2 -disablerule:BackupRule
msdeploy -verb:sync -source:recycleApp -dest:recycleApp="site/pool",recycleMode="StartAppPool",computername=COMPUTERNAME

Converting virtual directory to application on IIS

i have worked for a year now , on server side applications and everytime i add a site to the iis it is added as a virtual directory. none of my web sites worked as a virtual directory on the iis. all applications always had bugs untill the minute i converted them to applications.
after converting the main folder to application everything works.
what does it mean to "convert to application" and why all problems are solved when i do that ?
Have you read the guidance provided by the IIS team http://learn.iis.net/page.aspx/150/understanding-sites-applications-and-virtual-directories-on-iis/?

IIS 7.5 Does Not Reset

Setup: Windows Server 2008 R2, IIS 7.5
We currently have multiple ASP.NET applications hooked up to the "Default Web Site" site in IIS on a server.
Sites
Default Web Site
aspnet_client
Site_v1
Site_v2
Site_v3
I have recompiled the binary for the site, and copied over the files for "Site_v1", then done an IISRESET command.
My issue is that the web app does not actually reset. Our app logs initialization of certain core objects, and the logs do not show that the app is restarting.
Our current theory is that some user has a browser open to one of the default web sites, and that's preventing me from correctly resetting IIS.
Anyone seen anything like this?
Thanks in advance.
Note: I'm posting this to Stack Overflow and not Super User because this is a problem on a development server. I'd like to solve this as a developer correctly compiling an application, rather than as a sys admin changing server settings. Hope that makes sense.
UPDATE:
From Werner's suggestion in the comments, I deleted the temporary files for Site_v2, but could not delete them for Site_v1. Some process was locking the files. After resetting IIS, Site_v1 was working properly, but not Site_v2.
Superconfused!
MS have stopped support for the IISReset command, which means that your approach is OK, but will not work any more. It works for IIS6.0, but not 7.0 or 7.5.
Ref: http://technet.microsoft.com/en-au/library/dd364308%28v=ws.10%29.aspx
It can be done "by hand" using the GUI, but that is not scripted. I have the same issue, working on an alternative.

Resources