Gradual upgrade of asp.net website?

Is there a good way to make incremental changes on an asp.net site without republishing the entire site?

I am moving the old website from classic asp to asp.net, and one of the things that happened on the site before was that individual pages changed in isolation. The site is located on only one server and has many files, so re-publishing will take some time throughout the site. I would like to avoid this or at least make it as short as possible.

Each page has code behind the file, as well as some things used by each page in App_Code (just in case, which changes the answer).

+4
source share
6 answers

If you create a website (and not a web application where all the code is compiled into a .dll in the / bin folder), and it looks like you are, then you can really only deploy files that are changed to the server - up to the value set in numRecompilesBeforeAppRestart in the <compilation> element of the machine or web.config file - this is the default - 15.

If you expand the change to the /app_code folder, this will lead to recompilation of the site, since this is a common area.

One note: in VS2008 and below, the site publishing team often publishes the entire site - I think this is much better in VS2010, where it is easier to publish only the changed files, so this will require a guide to deploy changes.

+4
source

You can install Visual Studio to create fixed assembly names. A single assembly is created for each page (master, ascx), and it will have the same name. With this option you can only update modified files. In any case, remember that this operation is error prone because you lose automatic control over the assembly interaction (if any), so you may encounter a run-time error if something goes wrong. Finally, if you have many pages, this mode will be less effective.

http://msdn.microsoft.com/en-us/library/aa992037.aspx

+2
source

You can split your web application into separate class libraries. Thus, you can simply recompile and drop the corresponding DLL into the published bin directory without publishing the entire site. Adding a version number to the class library will help determine it. Keep the code behind the files minimal by invoking methods in these class libraries.

+1
source

Why not have a few document roots for the website, one โ€œliveโ€ and one for โ€œstagingโ€. Post the changes in the "setting" area, check and test, and then switch the document roots to IIS (setting becomes live, setting becomes active) - this should take the site for the time needed to recycle the pool application and a little more. Update the old "live" to the new code base and wait for the next update.

0
source

By default, ASP.NET pages and associated codewords are compiled dynamically when the user first requests the page, so you really don't need to republish the entire site when you make just a couple of updates. You can publish only those files.

0
source

Splitting the application into Muti-Layered architecture, deploying only modified assemblies. To determine the dependencies and deploy their libraries / services to which they refer, also does not depend on compatibility issues. We also changed the internal code of the interface or whether we also changed the signature of the methods (interfaces) ... A good article with details http://www.codeproject.com/Articles/430014/N-Tier-Architecture-and-Tips#How for the correct N-Tier applications

E.I.V., Fani

0
source

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


All Articles