I am trying to run the Human interaction in Durable Functions and i got the sample from the microsoft doc page. You can get the code @ https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-phone-verification?tabs=csharp
I got the following error.
Method not found: ‘Void
Twilio.Clients.TwilioRestClient..ctor(System.String, System.String,
System.String, System.String, Twilio.Http.HttpClient)’
I installed following nuget packages
- Microsoft.Azure.WebJobs.Extensions.Twilio – 3.0.2
- Twilio – 5.75.1
Currently using .Net 6.0
2
Answers
I removed the Twilio nuget dependency and everything was OK, there was a conflict between the Microsoft.Azure.WebJobs.Extensions.Twilio and Twilio
The
Microsoft.Azure.WebJobs.Extensions.Twilio
hasn’t been updated since 1/26/2021 so it depends on an old version of theTwilio
package, version 5.6.3.In version 5.6.3 of the
Twilio
package, the constructor looked like this:(source code on GitHub)
But in the version that you upgraded the
Twilio
package to, the constructor is like this:(source code on GitHub)
So the
Microsoft.Azure.WebJobs.Extensions.Twilio
can’t find the constructor signature it is looking for. It may look like it’s backwards compatible, but it’s a breaking change becauseMicrosoft.Azure.WebJobs.Extensions.Twilio
has to be recompiled with the new version to start using the updated constructor.You have a couple of options:
Microsoft.Azure.WebJobs.Extensions.Twilio
package and straight up use theTwilio
package and use the Twilio SDK to send the messages. The Azure package doesn’t do that much for you so you should be able to swap it out with relative ease. I would go with this option for now.Twilio
dependency so it falls back on the version thatMicrosoft.Azure.WebJobs.Extensions.Twilio
uses, although then you’ll be with an outdated version of theTwilio
package which is also not good as you may miss out on bug and security fixes.Microsoft.Azure.WebJobs.Extensions.Twilio
, update theTwilio
dependency and use your own version of the code.There’s two ways for Twilio or Azure to fix this, either Twilio provides an overload without the
edge
parameter, or the Azure updates theTwilio
package to something more recent.I will open issues in both projects so we can get both updates started at the same time and hopefully this won’t be an issue anymore in the near future.