Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
With ASP.NET, there's DLL "mirroring", so one can update a DLL without stopping the application pool for the website.

With .NET Core apps, it does not appear that such mirroring occurs (so I've read on SO when I researched this issue) and I'm constantly having to stop the AP, update the DLL, then restart the AP.

Very annoying. Any solutions for this? Is there a command line call to stop/start the Application Pool?

What I have tried:

Researched the problem but never found a solution.
Posted
Updated 3-Jul-20 0:35am

1 solution

I tend to use the app_offline.htm file, which takes the application off-line, combined with a batch file.

app_offline.htm:
HTML
<!DOCTYPE html>
<html>
<head>
    <title>Application Offline</title>
    <meta http-equiv="refresh" content="60" />
    
    <style type="text/css">
    div
    {
        background-color: #ffc;
        padding: 10px;
        border: 1px solid black;
    }
    </style>
</head>
<body>
    <div>
        This application is currently offline. Please try again in a few moments.
    </div>
</body>
</html>
update.bat:
BAT
@ECHO OFF

REM Take a backup of the site:
robocopy .\WWW .\_bak /Z /E /MIR

REM Take the site off-line:
xcopy app_offline.htm .\WWW\ /Y

REM Pause for 5 seconds to wait for the app to unload:
ping localhost -n 5 > NUL

REM Copy in the new files:
robocopy .\_staging .\WWW /XF app_offline.htm /Z /E /MIR

REM Bring the application back online:
del .\WWW\app_offline.htm
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900