-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.MissingMethodException when ITwilioRestClient created via DI #768
Comments
Changing the signature of a method or constructor is a breaking change. Even if it's a new optional parameter, as you can see above, it requires depending libraries to recompile and release a new version. @twilio maintainers, if you add new parameters, provide overloads so the original signature still exists for existing libraries. |
@keltex Thank you for raising this issue. Our team is currently looking into this issue and will be prioritised in the current sprint |
This PR recompiles against your new ctor signature, so it'll work again if merged and released. |
I'm hitting the same issue. Reverting to v7.5.1 worked for me too. |
This issue is fixed in the codebase and will be part of next release |
I updated to Twilio 7.8.0 and Twilio.AspNet.Core 8.1.0 today. Still getting an error:
Reverting to Twilio.AspNet.Core 8.0.2 fixes it. Seems both libraries were modified to support the other and now they're again no longer compatible. |
Why aren't these two libraries in the same repo and released concurrently? It's not great to have releases that are incompatible with each other like this.
…On December 5, 2024 6:02:44 PM PST, ltctech ***@***.***> wrote:
@Swimburger @AsabuHere
I updated to Twilio 7.8.0 and Twilio.AspNet.Core 8.1.0 today. Still getting an error:
```
System.MissingMethodException: Method not found: 'Void Twilio.Clients.TwilioRestClient..ctor(System.String, System.String, System.String, System.String, Twilio.Http.HttpClient, System.String, Twilio.AuthStrategies.AuthStrategy)'.
at Twilio.AspNet.Core.TwilioClientDependencyInjectionExtensions.CreateTwilioClient(IServiceProvider provider)
```
Reverting to Twilio.AspNet.Core 8.0.2 fixes it. Seems both libraries were modified to support the other and now they're again no longer compatible.
--
Reply to this email directly or view it on GitHub:
#768 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
Twilio.AspNet is a community project, not officially supported by Twilio. Regardless, the change that was just made in this repo was another breaking change because the position of the |
Twilio.AspNet has been updated to use the latest version of Twilio C# helper library again. |
I have just been caught by this too - i used the latest libraries for both projects are they are not compatible. (7.2.2 and 8.1.0) Changing the parameter order is a semver breaking change. |
It looks like 8.1.1 fixes this, but there is no release notes to this effect I would still advise you add the constructor back to this library to make it backwards compatible. But you are going to have to leave the new one there too. When you next do a major release you can tidy it up. Judging by nuget download counts this hasn't affected may users yet. You can still fix it before more and more people come here to complain. |
I will check this shortly. |
Issue Summary
This is a dotnetcore application running on dotnet 7. When attempting to instatiate a ITwilioRestClient via dependency injection, I get the following exception:
System.MissingMethodException: 'Method not found: 'Void Twilio.Clients.TwilioRestClient..ctor(System.String, System.String, System.String, System.String, Twilio.Http.HttpClient, System.String)'.'
This is happening on twilio 7.6.0. If I roll back to twilio 7.5.1 the bug does not occur.
Steps to Reproduce
Code Snippet
Here's my code to create the service in startup.cs
Then the exception occurs when my razor page loads:
Exception/Log
Technical details:
The text was updated successfully, but these errors were encountered: