.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET 5.0+

XafApplication.CheckCompatibilityType Property

Specifies how the database and application compatibility is checked.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v21.2.dll

Declaration

[DefaultValue(CheckCompatibilityType.ModuleInfo)]
public CheckCompatibilityType CheckCompatibilityType { get; set; }

Property Value

Type Default Description
CheckCompatibilityType

ModuleInfo

A CheckCompatibilityType enumeration value specifying how the database and application compatibility is checked.

Remarks

You can set CheckCompatibilityType to the following values.

Value

Description

DatabaseSchema

The following checks are performed utilizing native XPO approaches:

  • The database exists.
  • All required tables exist.
  • All required columns exist.

The XafApplication.DatabaseVersionMismatch event occurs if any of these checks fails.

ModuleInfo

In the ModuleInfo mode, a ModuleInfo table is created in the database to check the compatibility of an application and its database. This table stores information on the module versions used in the application. When checking the compatibility of the database and the application, the versions stored in the ModuleInfo table are compared with actual module versions. The XafApplication.DatabaseVersionMismatch event occurs in case of a mismatch.

By default, each module’s version is set to “1.0.*“ using the AssemblyVersion attribute in the Properties\AssemblyInfo.cs file. The asterisk sign in the version indicates that the build and revision numbers in the version are autoincremented, and so the version value is updated with each new build. As a result, the WinForms and ASP.NET Web Forms module versions may become unsynchronized if you build WinForms and ASP.NET Web Forms applications separately (e.g, when creating a ClickOnce installation or deploying to IIS).

Note that the use of the ModuleInfo mode is more complicated, but it allows ensuring the business logic compatibility in addition to the data model compatibility. To learn more about this mode, refer to the Update Application and Database Versions using the ModuleInfo Table topic.

The CheckCompatibilityType property value can be changed in the Application Designer:

CheckCompatibilityType

By default, CheckCompatibilityType is set to ModuleInfo in XafApplication code. However, the default value is overridden to DatabaseSchema in code generated by the Solution Wizard. This is done to keep the behavior of applications created in earlier versions unchanged.

Tip

The IObjectSpaceProvider.CheckCompatibilityType property allows you to specify the mode individually for each Object Space Provider (in case you use multiple databases).

The following code snippets (auto-collected from DevExpress Examples) contain references to the CheckCompatibilityType property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also