Deploy published code?

I published the code with Visual Studio 2010 , and then deployed the working code on a production server.

Everthing is working fine.

Suppose I need to make some changes to the code behind the file (.cs file). Do I need to publish code again and again with visual studio 2010? Or do I just need to replace the bin folder on the production server?

Currenlty I publish the code every time I change the code in the code behind the file and replace the publication code on the production server.

+4
source share
3 answers

Your bin directory will contain your compiled code, so if you change everything, you can expand the bin folder.

But when you change other files, such as your web.config, aspx, css or javascript files, these changes will not appear in your bin directory. These physical files will need to be deployed.

Because deployment can be a tedious and repetitive process, it would be best to automate this. If you configure your web server for WebDeploy , you can automatically deploy from Visual Studio to your server. WebDeploy will track all changes and make sure they are deployed.

+4
source

if you use only .cs files, then you can replace the dll files.

when you post:

If you select "Replace matching files", it only copies the changed files

it is equal to replacing the dll as described above, and is also better than doing it manually.

sometimes we can have css or javascripts changes, but forget to add them.

+1
source

If you try to change code by code, you do not need to republish the entire project and just need to redefine the production files. Because it is a partial class of an aspx page and compiled at runtime.

But it’s better to do this automatically using some tools. He can avoid human errors and run a test to make sure that your changes do not violate any functions.

+1
source

Source: https://habr.com/ru/post/1413124/


All Articles