I'm implementing the new version of ASP.NET Identity 2.0 that was released a week ago.
The IdentityConfig.cs is doing its job well and the user's information is added to the database and an an Email is sent to the user for confirmation. All is fine, however this error is fired unnecessarily (it sounds like a race between scripts). It's only fired when I use the Email service:
An asynchronous module or handler completed while an asynchronous operation was still pending
The code behind is the following:
public class EmailService : IIdentityMessageService
{
public Task SendAsync(IdentityMessage message)
{
var mailMessage = new MailMessage(
"******@d******.com",
message.Destination,
message.Subject,
message.Body
);
// Send the message
SmtpClient client = new SmtpClient();
client.SendAsync(mailMessage, null);
return Task.FromResult(0);
}
}
How can I solve this?
Thanks in advance.
G