[英]Writing to folder through Process - ASP.NET and Windows Server 2008 R2
I generate PDF files from HTML page through wkhtmltopdf (using Process from C#). 我通过wkhtmltopdf(使用C#中的Process)从HTML页面生成PDF文件。
On local system (Windows 7) it's works, but on Windows Server 2008 R2 I have "System.IO.FileNotFoundException". 在本地系统(Windows 7)上可以运行,但是在Windows Server 2008 R2上我具有“ System.IO.FileNotFoundException”。 wkhtmltopdf executed by Process (C#) not have enough permission to write file. 由Process(C#)执行的wkhtmltopdf没有足够的权限来写入文件。
I tested a lot of folders (in example: "APPDIR/Content/temp"), but I have no idea what should I do. 我测试了很多文件夹(例如:“ APPDIR / Content / temp”),但我不知道该怎么办。
The process your application runs as, has to have sufficient permissions to write to a folder. 您的应用程序运行的过程必须具有足够的权限才能写入文件夹。
Your (most likely judging by ASP.NET tag) website can be configured to run as any user you want in IIS management console. 您的网站(很可能由ASP.NET标记判断)可以配置为在IIS管理控制台中以所需的任何用户身份运行。
By default the application pool runs as ApplicationPoolIdentity and to grant access permissions to it you would use: IIS AppPool\\ApplicationPoolName
account. 默认情况下,应用程序池作为ApplicationPoolIdentity运行,并向其授予访问权限,您将使用: IIS AppPool\\ApplicationPoolName
帐户。
You can also change the application pool to run as another account and configure folder permissions for that account instead. 您还可以将应用程序池更改为作为另一个帐户运行,并为该帐户配置文件夹权限。
You will have to type the full account name in the box as search is an Active Directory feature and doesn't work as expected for local accounts (In Select Users or Groups dialog) 您将必须在框中输入完整的帐户名称,因为搜索是Active Directory功能,并且无法按预期在本地帐户中使用(在“选择用户或组”对话框中)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.