Asp.Net applications can utilize a companion .Net Administrative Utility application to manage an AppLife Update based update process.
When using a utility application, an AppLife Update controller is added to the utility and an update process is created. Once the utility is update enabled, a user can log on to the web server and utilize the admin utility to initiate an update process.
The advantages of this method include being the most straightforward implementation, as well as a richer user experience during the actual updating process. The primary disadvantage is that it requires a user to actually log on to the web server. Often the person responsible for the Asp.Net application itself does not have access to the web server and must enlist the aid of a support engineer to perform application updates.
Updating web files
In order to update files in the web root, you must be able to determine its location on the server. Knowing where the admin utility exists in relation to the web root allows you to add update actions to your AppLife update project that places new files in the proper location.
Consider the following folder structure:
We can navigate to the web root from the installed location of the Admin Utility by moving up one folder and into the ExampleAspNetAppRoot folder.
Therefore file actions within an AppLife update project can be configured to target the web root folder using a relative Target client folder path:
Using Explicit Pathing
Alternative to relative pathing, the admin utility can look up the web root location on the server, and then pass this full path into the update process using Shared Properties. Update actions can then use this path.
Updates can then be created for the Admin Utility that target replacing files within the web root. See Building Updates for more information on building web updates.
Applying an Update
Applying an update requires logging in and launching the Admin Utility. Once launched, the update utility will check for updates.
Versioning
When using an Admin Utility for updating, it is advantageous to use a versioning scheme that does not require rebuilding the utility application to increment the version number. This is so that you can update the Asp.Net files without updating the Utility Application assembly itself. A common versioning scheme employed is to use an app.config file to host a “version” application setting. Config files can be easily updated during the update process by using an AppLife Update Xml Update Action.
<configuration>
<appSettings>
<add key="version" value="1.0.0.0"/>
</appSettings>
</configuration>
Setting the controller:
updateController1.Version = new Version(ConfigurationManager.AppSettings["version"]);
Update Action that modifies the config file during an update.