Apologies if I'm being slow - I've incorporated Rotativa and it works on my dev machine but when I try to use it on the server I receive the below:
Server Error in '/' Application.
Unhandled Execution Error
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Exception:
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.
Stack Trace:
[Exception]
Rotativa.WkhtmltopdfDriver.Convert(String wkhtmltopdfPath, String switches, String html) +822
Rotativa.ViewAsPdf.CallTheDriver(ControllerContext context) +1027
Rotativa.AsPdfResultBase.BuildPdf(ControllerContext context) +201
Rotativa.AsPdfResultBase.ExecuteResult(ControllerContext context) +27
Castle.Proxies.ControllerActionInvokerProxy.InvokeActionResult_callback(ControllerContext controllerContext, ActionResult actionResult) +21
Castle.DynamicProxy.AbstractInvocation.Proceed() +69
Glimpse.Mvc3.Interceptor.InvokeActionResultInterceptor.Intercept(IInvocation invocation) +431
Castle.DynamicProxy.AbstractInvocation.Proceed() +204
System.Web.Mvc.<>c__DisplayClass1c.b__19() +33
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func1 continuation) +613 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList
1 filters, ActionResult actionResult) +263
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +729
System.Web.Mvc.Controller.ExecuteCore() +162
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +159
System.Web.Mvc.<>c__DisplayClassb.b__5() +62
System.Web.Mvc.Async.<>c__DisplayClass1.b__0() +15
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +1656
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +540
Server is Server 2008 R2 and application is dotNet 4.5
Call to Rotativa is
return new ViewAsPdf("View", "~/Views/StaffExpenses/_ViewLayout.cshtml", claim)
{
PageSize = Size.A4,
PageOrientation = Orientation.Landscape,
PageMargins = {Left = 0, Right = 0, Top = 0, Bottom = 0}
};
Both Authenticated Users and the app pool have execute permissions on the files in the Rotativa folder which has deployed to the server with the application.
Project uses Windows Authentication