Skip to main content
All docs
V24.2
.NET 8.0+

XAF0005: XAF controller classes should be public

Severity: Error

XAF requires that the controller’s class should be public. Otherwise, the class is not recognized as a controller.

This diagnostic works only for classes derived from the DevExpress.ExpressApp.Controller class. This diagnostics does not work for abstract classes.

Examples

Invalid Code

using DevExpress.ExpressApp;
using DevExpress.Persistent.BaseImpl;

namespace MySolution.Module.Controllers {
    // The class must be public
    //class ExampleController1 : ViewController { // Error: XAF0005
    //}

    // The class must be public
    //private class ExampleController2 : ViewController { // Error: XAF0005 
    //}
    // ...

Valid Code

using DevExpress.ExpressApp; 
using DevExpress.Persistent.BaseImpl;

namespace MySolution.Module.Controllers {
    // This class meets the requirements
    public class ExampleController : ViewController { 
        // ...
    }
} 

How to Fix

Declare the controller’s class with the public keyword.