简体   繁体   中英

Clean Windows Azure Website

My ASP.NET MVC project pushed to a Azure website with an extra DLL which is invalid. This is keeping the project from running correctly. If a new website is created it works perfectly. Cleaning the project locally and redeploying does not fix the problem. Is there a way to perform a "remote clean?"

This project is being deployed directly from Visual Studio with the publish menu item.

When you right click and click Publish Web on the left hand side there should be a settings tab. Click this. Then expand the option under File Publish Options and check the Box for Remove addtional files at destination. (This will wipe out whats already there)

在此输入图像描述

Also can be detailed here: MSDN

Another trick to delete an entire Azure website deployment which can be done entirely in the Azure portal is:

1) Create a new empty deployment slot under the Azure website. 2) Swap it with the parent Azure website.

That will give you an empty Azure website. If you want you can delete the deployment slot afterwards.

You can also use console to delete any file. Kudu is a web tool that allow you to see inside of Azure web application.

在此输入图像描述

Two ways to access Kudu

  1. go here: https://yoursite.scm.azurewebsites.net/DebugConsole/?shell=powershell (replace with your real website name)
  2. login to portal > app services > your site > Development tools > Advanced tools. 在此输入图像描述

您还可以通过Webmatrix删除文件(Azure配置门户中的页脚菜单中的链接)

  1. Download the profile from Azure portal 下载发布配置文件

  2. Import publish profile in VS 在此输入图像描述

  3. Stop the web app in Azure portal 在此输入图像描述 Stopping the web app ensures existing files including dlls and other resources will be deleted after publish succeeds.
    This step might not be necessary , however, the existing web app could have some dlls that cannot be removed during publish directly, returning error messages like:

Web deployment task failed. (Unable to perform the operation ("Delete File") for the specified directory ...



4. Publish with “Remove additional files at destination” checked 在此输入图像描述

  1. Start the web app again after publish succeeds.

对于Linux服务器,你不明白,CMD,那么所有你需要做的,删除部署,然后创建FTP部署凭据,有你的FTP客户端去了你的自我清洁wwwroot文件夹。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM