Breaking Change T1221083
Visible to All Users

Core - The client-server communication protocol changed to WebSocket in .NET 6+ applications with Middle Tier Security

What Changed

  • In XAF WinForms applications with Middle Tier Security (for both EF Core and XPO ORM), the WebSocket protocol is now used for client-server communication instead of ASP.NET Core Web API.
  • The client application now retrieves the list of security permissions for the current user only when the user logs in (previously, the client application queried the server for permissions on every request).

Reasons for Change

To improve performance on high-latency connections (for instance, when servers are distributed far away from clients), we changed the communication protocol to WebSocket and reduced the number of client-server requests.

Impact on Existing Apps

The change affects XAF WinForms applications (.NET 6+ only) that use Middle Tier Security mode. The client application will no longer query the server for permissions required to work with an object each time a request is sent. Instead, the client application requests a list of permissions for the current user once, when the user logs in, and uses the obtained permissions until the user logs out.

How to Revert to Previous Behavior

  1. Disable WebSocket communication mode in the client app - use the UseWebSockets property:

    File: MySolution.Win/Startup.cs

    C#
    public class ApplicationBuilder : IDesignTimeApplicationFactory { public static WinApplication BuildApplication(string connectionString) { // ... builder.Security .UseMiddleTierMode(options => { // ... options.UseWebSockets = false; // ... }) // ... } }
  2. Enable stateless per-call mode in the Middle Tier Server app using the UsePerCallMode property:

    File: MySolution.MiddleTier/Startup.cs

    C#
    public class Startup { // ... public void ConfigureServices(IServiceCollection services) { // ... services.Configure<WebApiSecuredDataServerOptions>(options => { options.UsePerCallMode = true; }); // ... } }

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.