dnn9dotnetnuke

How to get the dnn module version using c#


I would like to get the version in a DotNetNuke Module. I try:

new ModuleController().GetModule(this.ModuleId).ModuleVersion

but its always -1.

On the .dnn file I have this definition:

<package name="xxxx" type="Module" version="02.01.88">

How could I get the "02.01.88" string?


Solution

  • I just found that we could use:

    new ModuleController().GetModule(this.ModuleId).DesktopModule.Version