Skip to content

[Desktop] Could not load file or assembly Uno.Extensions.Authentication.MSAL.WinUI #2438

Open

Description

@erikvilima

Current behavior

When adding AuthenticationMsal to <UnoFeatures> and launching on Desktop an exception is thrown:

System.IO.FileNotFoundException: 'Could not load file or assembly 'Uno.Extensions.Authentication.MSAL.WinUI, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.'

Expected behavior

No response

How to reproduce it (as minimally and precisely as possible)

Repro: msal.zip
Binlog: msal_Debug_AnyCPU_Build_2024-04-24T13_41_23.9873602+01_00.zip

Workaround

No response

Works on UWP/WinUI

Yes

Environment

No response

NuGet package version(s)

Uno.Templates 5.2.28

{
  "msbuild-sdks": {
    "Uno.Sdk": "5.2.83"
  }
}
<UnoExtensionsVersion>4.1.14</UnoExtensionsVersion>
<UnoToolkitVersion>6.0.18</UnoToolkitVersion>
<UnoThemesVersion>5.0.13</UnoThemesVersion>
<UnoCSharpMarkupVersion>5.2.13</UnoCSharpMarkupVersion>

Affected platforms

No response

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

Activity

  1. added
    kind/bug
    triage/untriaged
    on Apr 24, 2024
  2. changed the title [-][Desktop] Could not load file or assembly 'Uno.Extensions.Authentication.MSAL.WinUI[/-] [+][Desktop] Could not load file or assembly Uno.Extensions.Authentication.MSAL.WinUI[/+] on Apr 24, 2024
  3. jeromelaban commented on Apr 24, 2024

    @jeromelaban
    Member

    @dansiegel @nickrandolph what package could be missing?

  4. dansiegel commented on Apr 24, 2024

    @dansiegel
    Contributor

    Currently would be unsupported. We need to look more into this. Technically it could be supported on Windows but Linux wouldn't be and Mac may or may not be supported now by MSAL, we need to see if they ever added support.

  5. agneszitte commented on Apr 29, 2024

    @agneszitte
    Member

    Currently would be unsupported. We need to look more into this. Technically it could be supported on Windows but Linux wouldn't be and Mac may or may not be supported now by MSAL, we need to see if they ever added support.

    @dansiegel, @jeromelaban So what we will be doing short term here, please?
    As it is impacting the ToDo sample migration at the moment (unoplatform/Uno.Samples#647)
    (cc @eriklimakc, @kazo0)

  6. dansiegel commented on Apr 29, 2024

    @dansiegel
    Contributor

    Short term we could either just remove the -desktop target or conditionally include it when building on Windows and remove the WSL profile.

    <!-- Conditionally include -desktop when building on Windows -->
    <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>

    And remove:
    https://github.com/unoplatform/uno.templates/blob/1c6e0388ab135d4adc119766f78c82d620f827a0/src/Uno.Templates/content/unoapp/MyExtensionsApp.1/Properties/launchSettings.json#L52-L57

  7. erikvilima commented on May 14, 2024

    @erikvilima
    ContributorAuthor

    Short term we could either just remove the -desktop target or conditionally include it when building on Windows and remove the WSL profile.

    <!-- Conditionally include -desktop when building on Windows -->
    <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
    

    And remove: https://github.com/unoplatform/uno.templates/blob/1c6e0388ab135d4adc119766f78c82d620f827a0/src/Uno.Templates/content/unoapp/MyExtensionsApp.1/Properties/launchSettings.json#L52-L57

    Should something else be done for this workaround to work? Conditionally including net8.0-desktop when building on Windows and removing the WSL profile didn't prevent that error from happening.

    cc @agneszitte @dansiegel @vatsashah45

  8. agneszitte commented on May 16, 2024

    @agneszitte
    Member

    Should something else be done for this workaround to work? Conditionally including net8.0-desktop when building on Windows and removing the WSL profile didn't prevent that error from happening.

    @dansiegel, @jeromelaban I can confirm what @eriklimakc shared, I am still having the exception
    System.IO.FileNotFoundException: 'Could not load file or assembly 'Uno.Extensions.Authentication.MSAL.WinUI, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.'
    even if I have this below in the ToDo.csproj (in addition to removing the "ToDo (Desktop WSL2)" profile in launchSettings.json):

        <TargetFrameworks>
          net8.0-android;
          net8.0-ios;
          net8.0-windows10.0.19041;
          net8.0-maccatalyst;
          net8.0-browserwasm;
        </TargetFrameworks>
    
        <!-- Conditionally include -desktop when building on Windows -->
        <!-- Related details here: https://github.com/unoplatform/uno.extensions/issues/2438 -->
        <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-desktop</TargetFrameworks>
    
    Related Call Stack:
    >	ToDo.dll!ToDo.App.InitializeComponent() Line 80	C#
     	ToDo.dll!ToDo.App.App() Line 13	C#
     	ToDo.dll!ToDo.Program.Main.AnonymousMethod__0_0() Line 11	C#
     	Uno.UI.Runtime.Skia.Wpf.dll!Uno.UI.Runtime.Skia.Wpf.WpfHost.StartApp.__CreateApp|20_0(Microsoft.UI.Xaml.ApplicationInitializationCallbackParams _)	Unknown
     	Uno.UI.dll!Microsoft.UI.Xaml.Application.StartPartial(Microsoft.UI.Xaml.ApplicationInitializationCallback callback) Line 91	C#
     	Uno.UI.dll!Microsoft.UI.Xaml.Application.Start(Microsoft.UI.Xaml.ApplicationInitializationCallback callback) Line 262	C#
     	Uno.UI.dll!Microsoft.UI.Xaml.Application.StartWithArguments(Microsoft.UI.Xaml.ApplicationInitializationCallback callback) Line 80	C#
     	Uno.UI.Runtime.Skia.Wpf.dll!Uno.UI.Runtime.Skia.Wpf.WpfHost.StartApp()	Unknown
     	Uno.UI.Runtime.Skia.Wpf.dll!Uno.UI.Runtime.Skia.Wpf.WpfHost.RunLoop()	Unknown
     	Uno.UI.Runtime.Skia.dll!Uno.UI.Runtime.Skia.SkiaHost.RunCore()	Unknown
     	Uno.UI.Runtime.Skia.dll!Uno.UI.Runtime.Skia.SkiaHost.Run()	Unknown
     	ToDo.dll!ToDo.Program.Main(string[] args) Line 18	C#
    
  9. nickrandolph commented on May 17, 2024

    @nickrandolph
    Contributor

    Should something else be done for this workaround to work? Conditionally including net8.0-desktop when building on Windows and removing the WSL profile didn't prevent that error from happening.

    @dansiegel, @jeromelaban I can confirm what @eriklimakc shared, I am still having the exception System.IO.FileNotFoundException: 'Could not load file or assembly 'Uno.Extensions.Authentication.MSAL.WinUI, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.' even if I have this below in the ToDo.csproj (in addition to removing the "ToDo (Desktop WSL2)" profile in launchSettings.json):

        <TargetFrameworks>
          net8.0-android;
          net8.0-ios;
          net8.0-windows10.0.19041;
          net8.0-maccatalyst;
          net8.0-browserwasm;
        </TargetFrameworks>
    
        <!-- Conditionally include -desktop when building on Windows -->
        <!-- Related details here: https://github.com/unoplatform/uno.extensions/issues/2438 -->
        <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-desktop</TargetFrameworks>
    

    Related Call Stack:

    MacCatalyst isn't supported for MSAL either. I think for now, let's just remove the desktop tfm as we'd have to test whether it's supported.

  10. removed
    triage/untriaged
    on Jul 16, 2024
  11. added theissue type on Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions