Back to Devexpress

ModuleBase.Version Property

expressappframework-devexpress-dot-expressapp-dot-modulebase-247d11f5.md

latest2.7 KB
Original Source

ModuleBase.Version Property

Gets the major, minor, revision, and build numbers of a module’s assembly.

Namespace : DevExpress.ExpressApp

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
[Browsable(false)]
public virtual Version Version { get; }
vb
<Browsable(False)>
Public Overridable ReadOnly Property Version As Version

Property Value

TypeDescription
Version

A Version object that represents the current module’s assembly version.

|

Remarks

This property is used when the built-in Updater compares the module’s actual version with the module version in the database. If the actual module version is lower than the version in the database, an exception is raised; otherwise, the Updater updates the module version in the database to the actual one. This process is performed each time the application runs in the debugging mode, because each application has the following XafApplication.DatabaseVersionMismatch event handler, by default:

csharp
public partial class MySolutionWindowsFormsApplication : WinApplication {
   private static void MySolutionWindowsFormsApplication_DatabaseVersionMismatch(object sender, 
         DatabaseVersionMismatchEventArgs e) {
      if(System.Diagnostics.Debugger.IsAttached) {
         e.Updater.Update();
         e.Handled = true;
      }
   }
partial class MySolutionWindowsFormsApplication {
   //...
   private void InitializeComponent() {
      //...
      this.DatabaseVersionMismatch += this.MySolutionWindowsFormsApplication_DatabaseVersionMismatch;
      // ...
   }
   // ...
}

For more information on updating database versions, refer to the CheckCompatibilityType property description. If you need to implement your own Updater, use the Version property to get the actual module version.

See Also

ModuleBase Class

ModuleBase Members

DevExpress.ExpressApp Namespace