. netcore MVC Update when files are locked out of the way

Source: Internet
Author: User

When you deploy a Web app on IIS using the. Netcore Update, you find that the file is locked and cannot be overwritten as it was previously non-core, the following are the methods I use to solve this problem.

You can also refer to Microsoft's official documentation

Https://docs.microsoft.com/zh-cn/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.0&tabs=aspnetcore2x

There are several methods:

The simplest is to stop the website and update it.

Because I'm too lazy to feel that way every time I write a script (according to the first form of official offer)

1. Create the following files in an empty directory, respectively

The release directory is used to put files that are ready for updating, and usually the VS release is copied.

App_offline.htm This file is used for updates if someone visits the site display content, only the content of their own writing on the line, afraid of trouble directly write "site maintenance ..." can also

Update.bat the script used to perform the update is as follows

@echo Offset updatepackrootpath=e:\ Site Deployment \mvcmovie_updatepackset updatewebpath=e:\ Site Deployment \mvcmovie Set Offlinefilepath=%updatepackrootpath%\app_offline.htmset Updatesourcepath=%updatepackrootpath%\releaseecho * * * echo * Please confirm the following update message echo * Update package path:%updatepackrootpath%echo * Update target path:%updatewebpath %          echo * Press any key to start update echo ******************************************pauseecho start Update call xcopy%offlinefilepath%% updatewebpath%/s/q/y/icall xcopy%updatesourcepath%%updatewebpath%/s/e/q/y/idel%updatewebpath%\app_offline.htme Cho Update complete pause

The above "Updatepackrootpath", "Updatewebpath" two variables to change the value of your own corresponding to the subsequent execution of this bat can be automatically updated.

Lazy to build their own can be downloaded to change the bat inside the above mentioned two variable values can be.

Https://files.cnblogs.com/files/nekoyzx/UpdatePackTool.zip

. netcore MVC Update when files are locked out of the way

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.