What is the best way to publish my C# Asp.NET application on Azure?

Asked

Viewed 244 times

3

I started a project in college and I’m using Azure to host it. This is my first contact with this tool and I’m having great difficulty understanding it. I’ve looked for tutorials and explanations in the big google, but I only find old things and the tool is more improved now. When I publish my application for the first time in Visual Studio, everything happens normally, but in the second one already accuses error in Web.config. And I realize that when I delete a screen in my project and post it, the page I posted earlier is still hosted in Azure. This is the first time I work with a C# Asp.NET application, if you have more tips or advice, I will be very grateful ;)

2 answers

4

How best to publish my C# Asp.NET application to Azure?

Using Web Deploy. It is a built-in method within the Visual Studio interface. Simply download the Azure publication profile and import into your solution.

When I publish my application for the first time in Visual Studio, everything happens normally, but in the second one already accuses error in Web.config. And I realize that when I delete a screen in my project and post it, the page I posted earlier is still hosted in Azure.

Yes, Web Deploy does not erase old files by default.

You can use Webmatrix to make deletion of files no longer necessary.

  • That’s what I wanted to know. Thank you very much for your attention!

3

Only supplemented by @Gypsy’s reply.

Actually, by default, the Webdeploy method does not erase old files, but there is a simple, simple configuration.

In the "Publish Web" window, in the "Settings" tab, under the "File Publish Options" group, check the "Remove Additional files at Destination" option".

Publish Web / Settings / File Publish Options / Remove additional files at destination

So, with each deployment procedure, files no longer referenced by your projects will be deleted.

PS: This does not apply to the "App_data" folder, so much so that, to clean this, there is a dedicated checkbox.

  • Sometimes the file won’t even get in the way of what I’m doing, but it still bothers me to know that it’s there occupying space haha thanks for the help!

  • @Marcovinicius, we are two. rs.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.