Ian
Ian

Reputation: 161

Twilio.API on NuGet is out of date

The Twilio.API package has a dependency of RestSharp, but the latest version of RestSharp that is downloaded is 104.2 and the Twilio.API is referencing 104.1. I've worked around this by manually installing the right version of RestSharp using the Package Manager Nuget command line. Please can you update your Twilio.API NuGet Package with a version that references the correct release of RestSharp.

Thanks, Ian.

EDIT - More details on my setup:

I have a class library project where I installed the Twilio.Api NuGet Package and created a class with some methods that use the TwilioClient functionality. I reference this class library project in another project (same solution) and call into those classes that use Twilio features, it was at this point I get an exception saying:

Could not load file or assembly 'RestSharp, Version=104.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

I've tried installing the Twilio.Api package into a new console application project and it works flawlessly. So, it might be something todo with my Solution configuration.

Upvotes: 2

Views: 1166

Answers (2)

Olivier
Olivier

Reputation: 5688

I've had the same issue with Twilio 3.4.1 package.

Having a closer look at Twilio.Api dll with DotPeek gives the following:

assemblies

I opened RestSharp by double clicking the dependency... and here is the thing: It seems that nuget has installed RestSharp 104.5, while Twilio is expecting 104.4 !

This must be a misconfiguration of Twilio nupkg, I guess :/

To address the issue within visual studio package manager (View->other windows->package manager console and then select the right project) type:

Uninstall-Package RestSharp -Force
Install-Package RestSharp -Version 104.4.0

(replace 104.4.0 with the version you've got in the exception message)

Upvotes: 1

Devin Rader
Devin Rader

Reputation: 10366

Twilio evangelist here (and maintainer of the .NET helper lib).

Can you shoot me an email: devin [at] twilio [dot] com.

I tried spinning up a new project this morning and using the NuGet package and was unable to reproduce the assembly not found error, which is what I'd expect to see. I'd love to know more about your project specifics in order to try to reproduce the issue.

Upvotes: 2

Related Questions