twilio-csharp: Method not found: 'System.String[] System.String.Split(Char, System.StringSplitOptions)'

Issue Summary

This .NETFramework nuget package was updated today and now breaks.

The stack trace is:

at Twilio.Http.Request.buildUri()
at Twilio.Http.Request.ConstructUrl()
at Twilio.Clients.TwilioRestClient.Request(Request request)
at Twilio.Rest.Api.V2010.Account.MessageResource.Create(CreateMessageOptions options, ITwilioRestClient client)
at Twilio.Rest.Api.V2010.Account.MessageResource.Create(PhoneNumber to, String pathAccountSid, PhoneNumber from, String messagingServiceSid, String body, List1 mediaUrl, Uri statusCallback, String applicationSid, Nullable1 maxPrice, Nullable1 provideFeedback, Nullable1 attempt, Nullable1 validityPeriod, Nullable1 forceDelivery, ContentRetentionEnum contentRetention, AddressRetentionEnum addressRetention, Nullable1 smartEncoded, List1 persistentAction, ITwilioRestClient client)

The old line had: string[] strArray = uriBuilder.Host.Split('.');

The new line has: string[] strArray = uriBuilder.Host.Split('.', StringSplitOptions.None);

Technical details:

  • twilio-csharp version: 5.46.1
  • csharp version: .NET Framework 4.8 (same error on 4.6.1)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 25 (7 by maintainers)

Most upvoted comments

Same issue with 5.46.1. Rolling back to 5.46.0 is fine. Happens with a simple call to MessageResource.Create.

Same issue with Microsoft .NET applications. Twilio.6.3.0 - Framework 4.8 or later Twilio.6.2.5 - Framework 4.7.2

@Paulwills No, they fixed it in 5.55.0. Update your packages with reinstall, clean solution, then build.

I’m having this issue too and seeing the change in the decompiled code. This is probably due to your build server having a greater version of .NET than the ostensible target (4.5.1) so the wrong overload is being called.

This is what it is now (5.46.1): image

This is what is was in 5.46.0: image