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

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.