Score:1

IIS -- procedure to ensure new version of deployed web app is the one actually used

us flag

I am using IIS, Version 10 on Windows Server 2016.

When I deploy a new Web app it goes under "Sites" with an organization of:

ServerNameA and then several sites, including MySiteA, which uses ApplicationPoolA.

After successful deployment, I can verify the files are new.

The web-app is specifically a web-service using .NET Framework 4.5.2 and originally built in Visual Studio 2019.

I am using IIS with the GUI-based Internet Information Services (IIS) app. Therefore, this is a Windows-based procedure, not a script-oriented approach.

What I want is to make sure the website actually runs the new files without re-booting or even restarting all of IIS.

*Typically, I do the following procedure, with these steps in IIS: *

  • Refresh MySiteA from context menu in the website under sites

  • Stop ApplicationPoolA

  • Start ApplicationPoolA

  • Refresh MySiteA from context menu in the website under sites

I am assuming one or both of the "refresh" commands on the website are redundant, or perhaps refresh is all that is needed.

What is the minimum procedure (set of steps) on IIS needed to guarantee the new deployment files are used?

One can assume that the deployment itself was successful and that all needed files are there.

Lex Li avatar
vn flag
What is "refresh"? I don't think IIS ever has such a command in its management scripts or IIS Manager. Besides, what kind of web app? PHP? ASP.NET 4.x? ASP.NET Core?
JosephDoggie avatar
us flag
@Lex Li -- I edited my question to answer your questions in the above comment. Basically, refresh is a WINDOWS-GUI approach; this is not a scripting question. Also, it uses .NET FRamework 4.5.2 .....
Score:1
vn flag

Since you are working on ASP.NET 4.x (and ASP.NET Core), the most convenient way is to use app_offline.htm to trigger a full reload the web contents, and Microsoft has it well documented in,

https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/app-offline?view=aspnetcore-7.0

$pathToApp = '{PATH TO APP}'


New-Item -Path $pathToApp -Name "app_offline.htm" -ItemType "file"

# Provide script commands here to deploy the app

Remove-Item -Path $pathToApp\app_offline.htm
Score:1
ng flag

Recycling (i.e. restarting) the application pool should be enough for it to pick up the newly deployed files.

This can be easily done with PowerShell: https://learn.microsoft.com/en-us/powershell/module/webadministration/restart-webapppool

Related question: https://stackoverflow.com/questions/38311797/recycle-an-application-pool-using-a-powershell-script.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.