Reputation: 6006
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
Currently using .Net 6.0
Upvotes: 2
Views: 1199
Reputation: 6006
I removed the Twilio nuget dependency and everything was OK, there was a conflict between the Microsoft.Azure.WebJobs.Extensions.Twilio and Twilio
Upvotes: 0
Reputation: 7164
The Microsoft.Azure.WebJobs.Extensions.Twilio
hasn't been updated since 1/26/2021 so it depends on an old version of the Twilio
package, version 5.6.3.
In version 5.6.3 of the Twilio
package, the constructor looked like this:
public TwilioRestClient(
string username,
string password,
string accountSid = null,
string region = null,
HttpClient httpClient = null
)
But in the version that you upgraded the Twilio
package to, the constructor is like this:
public TwilioRestClient(
string username,
string password,
string accountSid = null,
string region = null,
HttpClient httpClient = null,
string edge = null
)
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 because Microsoft.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 the Twilio
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 that Microsoft.Azure.WebJobs.Extensions.Twilio
uses, although then you'll be with an outdated version of the Twilio
package which is also not good as you may miss out on bug and security fixes.Microsoft.Azure.WebJobs.Extensions.Twilio
, update the Twilio
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 the Twilio
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.
Upvotes: 4