I have just updated a MVC web application running on the ASP.NET Framework version 4.5.2. I am using Twilio to send an SMS message:
var twilio = new TwilioRestClient(twilioSid, twilioAuthToken);
var result = twilio.SendSmsMessage(twilioNumber, message.Destination, message.Body);
After the update, I am getting the following error:
System.TypeLoadException: Could not load type 'RestSharp.HttpBasicAuthenticator' from assembly 'RestSharp, Version=105.2.1.0, Culture=neutral, PublicKeyToken=null'.
The installed versions are:
I have seen a similar question posted back in November 2014 (8 months ago) and there is also some discussion on the Twilio Nuget page discussing an Alpha Version that is reported to remove the dependency on RestSharp.
Can anyone tell me what the status of the project is and what version options should be used?
Thanks.
Twilio developer evangelist here.
We had to "lock" the twilio-csharp library to version 105.0.1 due to the fact that every time RestSharp updates, we need to release a new version or fix bugs they introduce to the library. Seems they have just updated the library on August 16th which would have completely removed the Basic Authenticator module from the library
Now, since you're saying you updated RestSharp to version 105.2.1, I believe you will have done that by going to Nuget Package Manager and clicking Update All, which would then update your packages regardless of what is described on the packages.config file (even that file would then be updated).
To fix that, all you need to do, is go to your package manager console and run the following:
Install-Package RestSharp -Version 105.1.0
This will then revert your packages.config to use the correct version, and your project should work again.
As for your second question, we have been working on an Alpha version that uses a stripped out version of RestSharp, but that is unfortunately not yet safe for production yet.
Hope this solves your problem.
UPDATE: Just thought I'd add an update here to let you know I've now added a new version of the package that supports Restsharp 105.2.1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With