为ASPNET帐户添加权限 [英] Add permission for ASPNET account
问题描述
我正在使用PDFsharp(用于在asp.net中生成pdf文件),并收到错误消息访问路径'C:\ Program Files(x86)\ Common Files \ Microsoft Shared \ DevServer \ 10.0\ Tax_receipt.pdf'被拒绝."
I am using the PDFsharp (which is used to generate pdf file in asp.net), and got an error "Access to the path 'C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\10.0\Tax_receipt.pdf' is denied."
我猜它正在尝试将文件写入此文件夹,因此我尝试添加具有对该文件夹的写许可权的ASPNET帐户.我使用无法找到的计算机名\ ASPNET"和无法使用的网络服务".
I guess it is trying to write file to this folder so I tried to add an ASPNET account with write permission to that folder. I use "computer name\ASPNET" which can't be found and "Network Service" which didn't work.
有人知道如何添加权限吗?非常感谢!
Does anyone know how to add permission?? Many thanks!!
我最终使用MemoryStream代替FileStream,这将避免创建物理文件.
I use MemoryStream instead of FileStream finally, and this will avoid to create physical file.
推荐答案
我的猜测是您托管在IIS v7.5上.
My guess is that you are hosting on IIS v7.5.
在这种情况下,您需要向分配了asp.net应用程序的应用程序池的应用程序池标识授予ACL权限.
If this is the case, you need to grant ACL permissions to the application pool identity of the application pool to which your asp.net application is assigned.
例如,如果您已将IIS应用程序分配给默认应用程序池(DefaultAppPool),则需要授予 IIS AppPool \ DefaultAppPool
的权限(确保将IIS服务器计算机名称选择为位置).
For example, if you have assigned your IIS application to the Default Application pool (DefaultAppPool) you need to grant the permissions to IIS AppPool\DefaultAppPool
(make sure the IIS server machine name is selected as the location).
以下是一些相关资源:
这篇关于为ASPNET帐户添加权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!