Bug Report T943976
Visible to All Users

Core - PlatformNotSupportedException ("Windows Principal functionality is not supported on this platform") may occur in Blazor UI on Ubuntu Linux 20.04

created 4 years ago

Since version 20.2.3 i get the following Exception when running a XAF Blazor UI on Ubuntu Linux 20.04. The Error occurs directly on startup.

Save model changes

TestApp.Blazor.Server Error: 0 : 28.10.20 11:31:40.205 af284899-868c-496f-87f6-116b51d2bbe7 ================================================================================
The error occurred:

Type: PlatformNotSupportedException
Message: Windows Principal functionality is not supported on this platform.
Data: 0 entries
Stack trace:

at System.Security.Principal.WindowsIdentity.GetCurrent()
at DevExpress.ExpressApp.ModelDifferenceDbStore.GetCurrentUserId()
at DevExpress.ExpressApp.ModelDifferenceDbStore.SaveDifference(ModelApplicationBase model)
InnerException is null

Show previous comments (1)
A A
Axel Reif - AXP Consulting 4 years ago

    Hello Dennis,

    this is the full call stack:

    The error occurred:

    Type: UserFriendlyException
    Message: Cannot save user settings to the database.
    Please refer to the log file for details on the reason for this failure. If you require further assistance, please contact your Administrator.
    Windows Principal functionality is not supported on this platform.
    Data: 0 entries
    Stack trace:

    at DevExpress.ExpressApp.ModelDifferenceDbStore.SaveDifference(ModelApplicationBase model)
    at DevExpress.ExpressApp.XafApplication.SaveModelChanges()
    at DevExpress.ExpressApp.Blazor.BlazorApplication.LogOff()
    at DevExpress.ExpressApp.Blazor.Services.XafApplicationProvider.CreateApplication()
    at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) --- End of stack trace from previous location where exception was thrown --- at System.Lazy1.CreateValue()
    at System.Lazy`1.get_Value()
    at DevExpress.ExpressApp.Blazor.Services.XafApplicationProvider.GetApplication()
    at DevExpress.ExpressApp.Blazor.Templates.MainPageBase.get_Application()
    at DevExpress.ExpressApp.Blazor.Templates.MainPage.BuildRenderTree(RenderTreeBuilder __builder)
    at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b__6_0(RenderTreeBuilder builder)
    at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
    at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
    at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
    InnerException is null

    AG AG
    Alex Gn (DevExpress) 4 years ago

      Hello Axel,
      As a workaround, create the following ModelDifferenceDbStore descendant and use it in your application.

      C#
      public class CustomModelDifferenceDbStore : ModelDifferenceDbStore { public CustomModelDifferenceDbStore(XafApplication application, Type modelDifferenceType, Boolean isSharedModelDifference) : base(application, modelDifferenceType, isSharedModelDifference) { } public CustomModelDifferenceDbStore(XafApplication application, Type modelDifferenceType, Boolean isSharedModelDifference, String contextId) : base(application, modelDifferenceType, isSharedModelDifference, contextId) { } protected override string GetCurrentUserId() { String result = ""; try { result = base.GetCurrentUserId(); } catch { } return result; } }
      Dennis Garavsky (DevExpress) 4 years ago

        Axel, are you using XAF's security system in your Blazor app? If not, you can safely remove any code related to ModelDifferenceDbStore from your solution to avoid this behavior. For more information, see How to: Store the Application Model Differences in the Database. Your complete sample will help us better solutions faster.

        Answers approved by DevExpress Support

        created 4 years ago

        We have addressed the issue described in this ticket and will include a fix in our next maintenance update. To apply this solution before official release, request a hotfix by clicking the appropriate version link.

        Note: Hotfixes may be unavailable for betas/updates set for release within a week.

          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.