Skip to content

.NET client fails to load on Windows WPF apps, assumes it is on MAUI #60

Description

@rbakhshi

Describe the bug
Client sdk 5.0.0 fails to load in a WPF app in .NET8 net8.0-windows.

To reproduce

  • Create a simple WPF all using .NET8 (TargetFramework net8.0-windows).
  • Add launchdarkly client sdk 5.0.0
  • Init the sdk: LdClient.Init(context)

Expected behavior
It should not fail

Logs

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Maui.Essentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Maui.Essentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'Microsoft.Maui.Essentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
   at LaunchDarkly.Sdk.Client.PlatformSpecific.PlatformConnectivity.get_LdNetworkAccess()
   at LaunchDarkly.Sdk.Client.Internal.DataSources.DefaultConnectivityStateManager.UpdateConnectedStatus()
   at LaunchDarkly.Sdk.Client.Internal.DataSources.DefaultConnectivityStateManager..ctor()
   at LaunchDarkly.Sdk.Client.Internal.Factory.CreateConnectivityStateManager(Configuration configuration)
   at LaunchDarkly.Sdk.Client.LdClient..ctor(Configuration configuration, Context initialContext, TimeSpan startWaitTime)
   at LaunchDarkly.Sdk.Client.LdClient.CreateInstance(Configuration configuration, Context initialContext, TimeSpan maxWaitTime)
   at LaunchDarkly.Sdk.Client.LdClient.Init(Configuration config, Context initialContext, TimeSpan maxWaitTime)

SDK version
LD 5.0.0

Language version, developer tools

> dotnet --version
8.0.401

OS/platform
Windows 10

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions