More in this section

Forums / Developing with Sitefinity / Guidance for Updating Modules during Development

Guidance for Updating Modules during Development

2 posts, 0 answered
  1. EuclidLibrary
    EuclidLibrary avatar
    18 posts
    28 Aug 2008
    23 Dec 2011
    Link to this post
    At least for me, development is an iterative process (especially when interacting with a third party system).  Make a small change, build the project, and see if the change had the desired effect is the normal workflow.

    Unfortunately a custom module's install method is only called when the module is first registered.  Thus any changes to the configuration are not applied when we rebuild a module with a series of small changes to the module's UI definition code and/or pages.  Thus the assumption for developing a new module is that you are going to code the whole thing in one go and everything will be perfect.  I don't know about you, but I seldom get everything right on the first go around.

    So I guess my questions are:
    1.) When is the Update method on ModuleBase\ContentModuleBase called?  Specifically, what conditions trigger its invocation?
    2.) What is the best practice for undoing the previous installation and re-installing the module?  During development the path of least resistance would be to delete the previous configuration settings including service registration (aka taxonomy), automatically update database using Open Access auto-generated scripts, and run the install method again with the changes.
    3.) Can you provide a video/sample/documentation with instructions and best practices for updating a previously registered module.

    Note: I have figured out that if I change the assembly version number Open Access will automatically update the database with any changes.

  2. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    18 Sep 2017
    28 Dec 2011
    Link to this post

    1. This is done by changing the version number of the module (I see you already have this.) In AssemblyInfo.cs

    // [assembly: AssemblyVersion("1.0.*")]
    [assembly: AssemblyVersion("1.0.*")]
    [assembly: AssemblyFileVersion("1.0.*")]
    2. Removing the version number and module ID from SystemConfig.config should do the trick to apply any changes made to the module, however to completely install the module as it was never installed before
    I have tested with the SQL script from this forum post and it was working, it is removing the module tables and thus erasing any leftovers from its previous install, however this method is more inconvenient and making modification to a database managed by ORM may trigger errors I suggest doing a test on a test project.
    3. These are the reccomended ways of updating a module,
     All the best,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered