Skip to content

Async broken in library, causing deadlocks and responses not returning in non-console apps #235

@hunglee

Description

@hunglee

Hi,
I'm using the example code to send email on MVC web app but it not response on the line dynamic response = sg.client.mail.send.post(requestBody: mail.Get()); even it has been sent successfully. Am I missing something?

String apiKey = "APIKEY";
dynamic sg = new SendGrid.SendGridAPIClient(apiKey);

Email from = new Email("[email protected]");
String subject = "Hello World from the SendGrid CSharp Library";
Email to = new Email("[email protected]");
Content content = new Content("text/plain", "Textual content");
Mail mail = new Mail(from, subject, to, content);

 dynamic response = sg.client.mail.send.post(requestBody: mail.Get());

Note: the example code work fine on console app only (response after post)

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions