asp.net-mvc 清理 Windows Azure 网站

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17476525/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 02:59:28  来源:igfitidea点击:

Clean Windows Azure Website

asp.net-mvcazuredeploymentbuild-process

提问by Joshcodes

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?"

我的 ASP.NET MVC 项目使用无效的额外 DLL 推送到 Azure 网站。这使项目无法正确运行。如果创建了一个新网站,它可以完美运行。在本地清理项目并重新部署并不能解决问题。有没有办法执行“远程清洁”?

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

此项目是直接从 Visual Studio 中通过发布菜单项部署的。

回答by ElvisLives

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)

当您右键单击并单击左侧的发布 Web 时,应该会出现一个设置选项卡。点击这个。然后展开文件发布选项下的选项并选中删除目的地附加文件框。(这将消除已经存在的东西)

enter image description here

在此处输入图片说明

Also can be detailed here: MSDN

也可以在这里详细说明:MSDN

回答by MikeB

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

另一个可以完全在 Azure 门户中完成的删除整个 Azure 网站部署的技巧是:

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

1) 在 Azure 网站下新建一个空的部署槽。2) 与父 Azure 网站交换它。

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

这将为您提供一个空的 Azure 网站。如果需要,您可以在之后删除部署槽。

回答by Rm558

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

您还可以使用控制台删除任何文件。Kudu 是一种 Web 工具,可让您查看 Azure Web 应用程序的内部。

enter image description here

在此处输入图片说明

Two ways to access Kudu

两种访问 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. enter image description here
  1. 去这里:https: //yoursite.scm.azurewebsites.net/DebugConsole/?shell=powershell(替换为您的真实网站名称)
  2. 登录门户 > 应用服务 > 您的站点 > 开发工具 > 高级工具。 在此处输入图片说明

回答by Martenti

You can also delete files via Webmatrix (link in footer menu in Azure configuration portal)

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

回答by detale

  1. Download the profile from Azure portal Download publish profile

  2. Import publish profile in VS enter image description here

  3. Stop the web app in Azure portal enter image description hereStopping 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:
  1. 从 Azure 门户下载配置文件 下载发布配置文件

  2. 在 VS 中导入发布配置文件 在此处输入图片说明

  3. 在 Azure 门户中 在此处输入图片说明停止 Web 应用 停止 Web 应用可确保在发布成功后删除现有文件,包括 dll 和其他资源。
    这一步可能不是必需的,但是,现有的 Web 应用程序可能有一些无法在直接发布期间删除的 dll,返回如下错误消息:

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

Web 部署任务失败。(无法对指定目录执行操作(“删除文件”)...



4. Publish with “Remove additional files at destination” checked enter image description here



4. 发布时勾选“在目的地删除其他文件” 在此处输入图片说明

  1. Start the web app again after publish succeeds.
  1. 发布成功后再次启动 Web 应用程序。

回答by Ramomex1

for linux servers you dont get, CMD, then all you have to do its, Delete the deployment, then create deployment credentials for FTP and there you go with FTP client clean the wwwroot folder by your self.

对于你没有得到的 linux 服务器,CMD,然后你要做的就是删除部署,然后为 FTP 创建部署凭据,然后你用 FTP 客户端自己清理 wwwroot 文件夹。