Guidance for Updating Modules during Development
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.
Hi,
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.*"
)]