1

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.

2
  • 1
    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?
    – Lex Li
    Nov 9, 2022 at 21:16
  • @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 ..... Nov 9, 2022 at 21:42

2 Answers 2

1

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.

1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.