Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client never initializes on .NET Framework 4.8 MVC Application #31

Open
rkajbaf-experientgroup opened this issue Feb 17, 2024 · 6 comments
Labels
bug Something isn't working package: sdk/server

Comments

@rkajbaf-experientgroup
Copy link

Is this a support request?
No,

Describe the bug
Fails to ever initialize in a .NET Framework 4.8 Web Application on the latest version (8.0). Downgrading to 7.1 resolves the problem.

To reproduce
Try on a .NET Framework MVC Application. Client will never initialize.

Expected behavior
Should initialize.

Logs
If applicable, add any log output related to your problem.

SDK version
8.0

Language version, developer tools
.NET Framework v4.8

OS/platform
Windows

Additional context
Downgrading to 7.1 resolves the problem.

@tanderson-ld
Copy link
Contributor

Hello @rkajbaf-experientgroup and thank you for your feedback. Are you able to collect any logs? Could you please provide a code snippet of your configuration and call to start the SDK? Thank you!

@tanderson-ld
Copy link
Contributor

Another theory is that a cache or lockfile is holding a version of a library or dependency. Have you tried a clean build and/or do you use a package lockfile?

@pgeorge-costacoffee
Copy link

I am also having this problem; unrelated to the individual who posted this originally. I even opened a Stack Overflow post a couple months ago:

https://stackoverflow.com/questions/77869557/launchdarkly-example-doesnt-work-in-net-class-library-but-does-in-a-consoleapp

@pgeorge-costacoffee
Copy link

Here is the console output related to launch darkly:

'my.exe' (CLR v4.0.30319: my.exe): Loaded 'C:\my-project\bin\x64\buildconfig\LaunchDarkly.CommonSdk.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'my.exe' (CLR v4.0.30319: my.exe): Loaded 'C:\my-project\bin\x64\buildconfig\LaunchDarkly.ServerSdk.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'my.exe' (CLR v4.0.30319: my.exe): Loaded 'C:\my-project\bin\x64\buildconfig\LaunchDarkly.InternalSdk.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'my.exe' (CLR v4.0.30319: my.exe): Loaded 'C:\my-project\bin\x64\buildconfig\LaunchDarkly.Logging.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
2024-04-12 15:45:06.506 -05:00 [LaunchDarkly.Sdk] INFO: Starting LaunchDarkly client 8.3.0
'my.exe' (CLR v4.0.30319: my.exe): Loaded 'C:\my-project\bin\x64\buildconfig\LaunchDarkly.EventSource.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
2024-04-12 15:45:06.630 -05:00 [LaunchDarkly.Sdk.DataSource] INFO: Connecting to LaunchDarkly stream
2024-04-12 15:45:06.643 -05:00 [LaunchDarkly.Sdk] INFO: Waiting up to 10000 milliseconds for LaunchDarkly client to start...
2024-04-12 15:45:06.929 -05:00 [LaunchDarkly.Sdk.DataSource] ERROR: Unexpected error in stream processing: System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
2024-04-12 15:45:07.455 -05:00 [LaunchDarkly.Sdk.DataSource] INFO: Waiting 853 milliseconds before reconnecting...
2024-04-12 15:45:08.462 -05:00 [LaunchDarkly.Sdk.DataSource] ERROR: Unexpected error in stream processing: System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
2024-04-12 15:45:08.979 -05:00 [LaunchDarkly.Sdk.DataSource] INFO: Waiting 1064 milliseconds before reconnecting...
2024-04-12 15:45:10.199 -05:00 [LaunchDarkly.Sdk.DataSource] ERROR: Unexpected error in stream processing: System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
2024-04-12 15:45:10.715 -05:00 [LaunchDarkly.Sdk.DataSource] INFO: Waiting 2966 milliseconds before reconnecting...
2024-04-12 15:45:13.829 -05:00 [LaunchDarkly.Sdk.DataSource] ERROR: Unexpected error in stream processing: System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
2024-04-12 15:45:13.830 -05:00 [LaunchDarkly.Sdk.DataSource] INFO: Waiting 5497 milliseconds before reconnecting...
2024-04-12 15:45:16.657 -05:00 [LaunchDarkly.Sdk] WARN: Timeout encountered waiting for LaunchDarkly client initialization
2024-04-12 15:45:26.143 -05:00 [LaunchDarkly.Sdk.Evaluation] WARN: Flag evaluation before client initialized; data store unavailable, returning default value
2024-04-12 15:45:26.226 -05:00 [LaunchDarkly.Sdk.DataSource] ERROR: Unexpected error in stream processing: System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
2024-04-12 15:45:26.745 -05:00 [LaunchDarkly.Sdk.DataSource] INFO: Waiting 10881 milliseconds before reconnecting...

@pgeorge-costacoffee
Copy link

Based on the output, above dug in some more. Was able to resolve it following the steps here:

https://stackoverflow.com/a/78331233/16276333

@tanderson-ld tanderson-ld added the bug Something isn't working label Oct 3, 2024
@tanderson-ld tanderson-ld transferred this issue from launchdarkly/dotnet-server-sdk Oct 30, 2024
@tanderson-ld
Copy link
Contributor

Tried to reproduce this issue by creating a .NET Framework 4.8 class library and then using that in a console application. It appears to have worked fine, so at the moment we cannot reproduce this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working package: sdk/server
Projects
None yet
Development

No branches or pull requests

4 participants