【发布时间】:2019-12-15 20:22:37
【问题描述】:
我在执行此代码时收到Access Denied 消息:
var report = await _service.RenderAsync(new RenderRequest
{
Template = new Template
{
Recipe = Recipe.PhantomPdf,
Engine = Engine.None,
Content = html,
Phantom = new Phantom()
{
Header = header,
Footer = footer,
HeaderHeight = GetElementHeightOrDefault(header),
FooterHeight = GetElementHeightOrDefault(footer)
}
}
});
实际上它在执行_service.RenderAsync 方法时失败了,这是一个从IRenderService 实现的服务。
这是错误信息:
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at jsreport.Local.Internal.BinaryProcess.<InnerExecute>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at jsreport.Local.Internal.BinaryProcess.<ExecuteExe>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at jsreport.Local.Internal.LocalUtilityReportingService.<RenderAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
我从jsreport 找到了这个帖子,其中有人和我有同样的问题:formu.jsreport.net/topic/428
所以我按照以下步骤操作:
- 由于我在 IIS 中有一个 Web 应用程序和一个 IIS Api 服务,因此我将 IUSR 和 IIS_IUSRS 都添加到了应用程序中,并赋予了它们最高权限
- 确保我的解决方案是在管理员权限下执行的
- 禁用所有防病毒和 Windows 安全
但是这些都没有奏效。我在这里仍然面临同样的问题。
有人可以帮我吗?
【问题讨论】:
-
您能否尝试将 AppPool 中的模拟更改为管理员用户:IIS > 应用程序池 > 高级设置 > 身份(并将其更改为管理员帐户)
-
我不得不将其更改为 LocalSystem 身份。不知道为什么,但它奏效了。我希望它在 ApplicationPoolIdentity 下工作......但你能分享你的问题作为答案吗?它驱使我找到解决方案。
标签: c# asp.net .net iis jsreport