In this lesson, you will learn how to create a new XAF solution. You will also be able to run the generated WinForms and ASP.NET Web applications, and see the default application state.
In the main menu of Visual Studio, select File | New | Project... to invoke the New Project dialog.
In the Installed | Templates tree, expand the desired language (Visual C# or Other Languages | Visual Basic), and then choose DevExpress XAF. In the panel to the right, select DevExpress v19.2 XAF Solution Wizard, specify the new solution's name ("MySolution") and click OK.
This will invoke the Solution Wizard. In the first screen of the wizard, choose the target platform(s). You can create separate WinForms, ASP.NET, Mobile (maintenance mode) applications, or multiple applications at once. Choose the WinForms and ASP.NET platforms and click Next.
In the next screen, choose Entity Framework Code Fist or eXpress Persistent Objects, and click Next.
In the next screen, you can choose the security options of your application. Choose Active Directory as the Authentication type, Allow/Deny as Default Permission Policy (and select Client-Side Security - Integrated Mode as the Database security type if you chose the XPO ORM in the previous step) and click Next.
On the next screen, you can choose the required XAF modules, which will automatically be added to your application. Select the Business Class Library Customization module and click Finish.
Most of the other modules will be added manually in the Extra Modules section.
Once the solution has been created, you will see five projects in the Solution Explorer.
MySolution.Module - the basic module project that contains code common to WinForms and ASP.NET Web applications.
MySolution.Module.Web - the module project that contains code specific to the ASP.NET Web application.
MySolution.Module.Win - the module project that contains code specific to the WinForms application.
MySolution.Web - the ASP.NET application project is similar to the WinForms application, but generates a browser-based interface instead of a WinForms interface. Do not use this project for feature implementation. All application logic should be implemented in the appropriate Module projects.
MySolution.Win - the WinForms application project, which relies on basic and WinForms modules, automatically generates the Windows user interface. Do not use this project for feature implementation. All application logic should be implemented in the appropriate Module projects.
The wizard attempts to detect your installed SQL server and changes the connection string accordingly. Supported servers are Microsoft SQL Server (including the Express and LocalDB editions). To use another database system (PostgreSQL, MySQL, Oracle, SQLite, Firebird, etc.), change the ConnectionString argument in the App.config and Web.config files of the WinForms/ASP.NET application projects. Refer to the Connect an XAF Application to a Database Provider topic for details about connecting to different database systems.
You can now run the WinForms and ASP.NET applications. By default, the WinForms project is set as the startup project. To run the ASP.NET Web application, right-click the MySolution.Web project in the Solution Explorer, and select the Set as StartUp Project item from the context menu. Then, click Start Debugging or press the F5 key.
The following images show the resulting WinForms and ASP.NET applications. They will already contain the security options for your Active Directory account.