Clean Windows Azure Website

asp.net MvcAzureDeploymentBuild Process

asp.net Mvc Problem Overview


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.

asp.net Mvc Solutions


Solution 1 - asp.net Mvc

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)

enter image description here

Also can be detailed here: MSDN

Solution 2 - asp.net Mvc

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.

Solution 3 - asp.net Mvc

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

enter image description here

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. enter image description here

Solution 4 - asp.net Mvc

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

Solution 5 - asp.net Mvc

  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 here 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 enter image description here

  1. Start the web app again after publish succeeds.

Solution 6 - asp.net Mvc

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJoshcodesView Question on Stackoverflow
Solution 1 - asp.net MvcElvisLivesView Answer on Stackoverflow
Solution 2 - asp.net MvcMikeBView Answer on Stackoverflow
Solution 3 - asp.net MvcRm558View Answer on Stackoverflow
Solution 4 - asp.net MvcMartentiView Answer on Stackoverflow
Solution 5 - asp.net MvcdetaleView Answer on Stackoverflow
Solution 6 - asp.net MvcemamonesView Answer on Stackoverflow