Skip to content

Commit

Permalink
Fix #2422 SetAgentActivationMethod throws CultureNotFoundException in…
Browse files Browse the repository at this point in the history
… global-invariant mode (#2423)

Fixes #2422
  • Loading branch information
ben-kiplot authored Aug 19, 2024
1 parent b2621c8 commit b07c321
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Elastic.Apm/Api/Service.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ private static void SetAgentActivationMethod(IApmLogger logger, Service service)
{
static bool CheckForLoadedAssembly(string name)
{
return AppDomain.CurrentDomain.GetAssemblies().Any(n =>
n.GetName().Name.Equals(name, StringComparison.OrdinalIgnoreCase));
// Avoid using Assembly.GetName() which can't be used with globalization-invariant mode enabled
return AppDomain.CurrentDomain.GetAssemblies()
.Any(n => n.FullName.Split(',')[0].Equals(name, StringComparison.OrdinalIgnoreCase));
}

// Assume NuGet as the default.
Expand Down

0 comments on commit b07c321

Please sign in to comment.