1
votes

I've noticed that although I'm able to successfully deploy my web app (ASP.NET) to Azure using web publish in Visual Studio. I'm also able to successfully deploy individual files to the server directory, by right clicking on the file in the solution explorer and clicking publish.

However, changes to the code behind don't seem to run on the server without publishing the entire solution. Changes to the HTML/CSS etc are updated and become effective immediately, and the C# code is making it to the server successfully, but the server continues to run the previous code.

I have tried restarting the app in azure, and I've added the rules to prevent server caching.

Is there anything that a full web-publish does that the publishing of individual files doesn't do?

1

1 Answers

1
votes

Changes to your code (.cs files) are compiled into a code library file. This file is saved into the bin folder and will be named like your project, for example yourprojectname.dll. This is all done by Visual Studio.

For the changes in your code behind files to work, you need to publish the respective dll files to your host.

If you publish the project then the required dll files will also be included, so your changes will work.

Additionally;

You don't really want to publish your cs files at all. These are source code and aren't needed by the host server for your application to function. cs files should be checked into your version control system (i.e. GitHub repository)