Back to Devexpress

Add the XPO Middle Tier Server to an Existing WinForms Application (.NET)

expressappframework-403572-data-security-and-safety-security-system-security-tiers-middle-tier-security-xpo-add-middle-tier-to-existing-app.md

latest2.8 KB
Original Source

Add the XPO Middle Tier Server to an Existing WinForms Application (.NET)

  • Jan 19, 2026
  • 3 minutes to read

This topic contains step-by-step instructions on how to add a Middle Tier Security project to a WinForms application and use it as the Middle Tier Server.

A Middle Tier security project cannot be added separately; instead, create a new solution with Middle Tier security enabled, then copy and add the security project to your solution, and configure the application.

Add a Middle Tier Security Project

  1. Use the DevExpress Template Kit or CLI template to create a new solution.
    Specify the same name, additional modules, and authentication settings as in your project. Select XPO ORM and activate the Middle Tier Security option.

  2. Copy the MySolution\MySolution.MiddleTier folder from the newly created solution to your solution.

  3. Add the MiddleTier project to your solution. Right-click the solution in the Solution Explorer, choose Add | Existing Project… , and select MySolution.MiddleTier\MySolution.MiddleTier.csproj.

  4. Install the DevExpress.ExpressApp.Security.Xpo.Extensions.Win NuGet package to the MySolution.Win project.

  5. The Security System requires ApplicationUser and ApplicationUserLoginInfo business objects to store user information. If the MySolution.Module project does not contain these objects, add ApplicationUser and ApplicationUserLoginInfo objects to the MySolution.Module project as described in the following topic: Use the Security System.

  6. If your application is created with DevExpress v21.2 and below, add the following code to the MySolution.Win\Program.cs file:

  7. If the MySolution.Win\Program.cs file contains the following autogenerated code, comment it out:

  8. Right-click the Solution node in the Solution Explorer and choose Properties. In the Solution Property Pages dialog, expand the Common Properties node and select Startup Project. Choose the Multiple Startup Projects option and select the Start action for the MySolution.MiddleTier and MySolution.Win projects.

See Also

Configure the JWT Authentication for the Web API

Create an Application with the XPO Middle Tier Security