#asp.net-core #exception #rotativa
Вопрос:
у нас есть asp.net веб-приложение core 3.0.
Некоторые представления также отображаются в формате PDF.
Мы используем Rotativa, отличную библиотеку для создания pdf в Интернете.
Затем из этого кода:
return new ViewAsPdf("TicketPdf", ticketRicambio, dict)
{
FileName = "DDT Ticket n. " ticketConRicambi.TicketAssistenza.IdTicket.ToString() ".pdf",
PageSize = Rotativa.AspNetCore.Options.Size.A4,
CustomSwitches = customSwitches,
MinimumFontSize =
Convert.ToInt32(dimensioneTestoRotativa),
PageMargins =
{
Right = Convert.ToInt32(margineRightRotativa),
Left = Convert.ToInt32(margineLeftRotativa),
Top = Convert.ToInt32(margineTopRotativa) ,
Bottom = Convert.ToInt32(margineBottonRotativa)
}
};
у нас есть это исключение:
Category: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware
EventId: 1
RequestId: 80000a69-0000-fa00-b63f-84710c7967bb
RequestPath: /Pannello/ScaricaDDTTicket
SpanId: |ebddf8c1-43709e8290c089fb.
TraceId: ebddf8c1-43709e8290c089fb
ParentId:
An unhandled exception has occurred while executing the request.
Exception:
System.Exception
at Rotativa.AspNetCore.WkhtmlDriver.Convert(String wkhtmlPath, String switches, String html, String wkhtmlExe)
at Rotativa.AspNetCore.WkhtmltopdfDriver.ConvertHtml(String wkhtmltopdfPath, String switches, String html)
at Rotativa.AspNetCore.ViewAsPdf.CallTheDriver(ActionContext context)
at Rotativa.AspNetCore.AsResultBase.BuildFile(ActionContext context)
at Rotativa.AspNetCore.AsResultBase.ExecuteResultAsync(ActionContext context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|29_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](Stateamp; next, Scopeamp; scope, Objectamp; state, Booleanamp; isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(Stateamp; next, Scopeamp; scope, Objectamp; state, Booleanamp; isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
Пожалуйста, кто-нибудь может помочь нам справиться с этим?
Заранее спасибо.
Пока
Комментарии:
1. Привет, @peppe microtec. Вы проверили это сообщение? github.com/webgio/Rotativa . AspNetCore / проблемы / 5