I'm bumping my head to be able to solve it but I can not, the error you're giving is
An asynchronous module or handler completed while an asynchronous operation was still pending.
source error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
I am sending a request to generate a ticket, but this is an asynchronous error. I'm using the Fluent plugin for this.
code:
public async Task<FileStreamResult> Teste(){
var response = url.WithHeaders(
new
{
Authorization =
"Basic " + Convert.ToBase64String(
Encoding.UTF8.GetBytes(ApiKey + ":" + Password)),
ContentType = "application/x-www-form-urlencoded"
}).PostUrlEncodedAsync(boleto).Result;
var pdfBytes = response.Content.ReadAsByteArrayAsync().Result;
pdfBytesResult = pdfBytes;
MemoryStream ms = new MemoryStream(pdfBytesResult);
return new FileStreamResult(ms, "application/pdf");
}
The problem only occurs when the site is in production (IIS), when the site does not happen