Skip to content

FluentEmail.Sendgrid v2.5.0 & SendGrid v9.10.0 MissingMethodException #129

@rdhainaut

Description

@rdhainaut

Hi
I have the following exception with the latest version of SendGrid v9.10.0.
If I downgrade to SendGrid v9.9.0 the exception doesn t occured anymore.

$exception | 
{System.MissingMethodException: Method not found: 'System.Collections.Generic.Dictionary`2<System.String,System.Object> SendGrid.Response.DeserializeResponseBody(System.Net.Http.HttpContent)'.    
at FluentEmail.SendGrid.SendGridSender.SendAsync(IFluentEmail email, Nullable`1 token)    
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)    
at FluentEmail.SendGrid.SendGridSender.SendAsync(IFluentEmail email, Nullable`1 token)    
at FluentEmail.Core.Email.SendAsync(Nullable`1 token)    
at PigeonsMarket.Service.Authentication.Controllers.MessageController.Contact(Contact contact) in ...} | System.MissingMethodException

I have tested with the sample (from this article:

Below my code to test

public class Startup
{
        public void ConfigureServices(IServiceCollection services)
        {
           ...
           services
                .AddFluentEmail(AppSettings.WebMaster.Email)
                .AddRazorRenderer()
                .AddSendGridSender(AppSettings.SendGridKey);
        }
}
public class FooController {
        public async Task<IActionResult> Bar()
        {
               var model = new
               {
                     Name = "test name"
               };

              var template = "hi @Model.Name this is a razor template @(5 + 5)!";

               var email = _fluentEmail
              .To("test@mail.com")
              .Subject("test email subject")
              .UsingTemplate(template, model);
                
              var response = await email.SendAsync();
        }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions