Search code examples
twiliotwilio-apitwilio-functions

Twilio nuget package dependency issue


I am using Twilio in my project which is in Asp.Net MVC. for Voice call and call forwarding.

In My Project I have used Twilio.Api dll Version 3.4.1.0 Using thsis Dll I have implemented following functionality.

  1. List avaliable phone number.
  2. Purchase phone number.
  3. Delete purchsed phone number.
  4. Get Client token.

All this functionality is working fine.

But after few days , I have installed the Twilio (5.20.1) nuget package to integrate the Incoming call functionality in my web hook and Transfer this call in agent browser.

But here I am facing error due to package conflict. The type 'TwilioClient' exists in both 'Twilio.Api, Version=3.4.1.0, Culture=neutral, PublicKeyToken=null' and 'Twilio, Version=5.20.1.0, Culture=neutral, PublicKeyToken=null'

When I remove the reference of Twilio.Api dll My new code is working fine , But there comes error in Old functionality. And When I add the Reference of above dll My Old code works fine but there comes package conflict error in my new functionality

Now Please suggest whether I have to downgrade the my new package or upgrade the Old existing package. Or any other solutions or patches.


Solution

  • Twilio developer evangelist here.

    I'm not sure what the Twilio.API DLL that you have installed is. However, the Twilio package is our officially supported library and will allow you to perform all the functionality you have already, as well as the latest features in the API.

    I recommend you install the latest version of the Twilio library (now at 5.25.1), remove Twilio.API 3.4.1.0 and rewrite your old code to use the official library.