简体   繁体   English

如何向IIS中的Web api应用程序授予写入权限?

[英]how to grant write permissions to an web api application in IIS?

I simply have a web api application on IIS server that simply writes to text file on C:\\FileStorage\\test.txt however when I call this webservice I get the internal 500 error, after expanding the error,I get the following error, how do I grant write access to this web service on IIS server? 我只是在IIS服务器上有一个web api应用程序,它只是写入C:\\ FileStorage \\ test.txt上的文本文件,但是当我调用这个web服务时,我得到内部500错误,在扩展错误后,我得到以下错误,如何在IIS服务器上授予对此Web服务的写访问权限?

"ExceptionMessage": "Access to the path 'C:\\FileStorage\\test.txt' is denied.",
"ExceptionType": "System.UnauthorizedAccessException",
"StackTrace": "   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\r\n   at 

Grant permissions for that folder to the application pool. 将该文件夹的权限授予应用程序池。 So you'd go to the C:\\FileStorage folder in Windows and edit permissions, and add IIS APPPOOL\\appPoolNameHere as a user, then give it full permissions. 因此,您将转到Windows中的C:\\ FileStorage文件夹并编辑权限,并以用户身份添加IIS APPPOOL \\ appPoolNameHere,然后为其授予完全权限。

Hope that helps. 希望有所帮助。

EDIT 编辑

Step by Step Instructions... 分步说明......

-Open Windows Explorer - 打开Windows资源管理器

-Browse to your folder - 浏览到您的文件夹

-Right click the folder and go to Properties - 右键单击​​该文件夹,然后转到“属性”

-On the Security tab click Edit - 在“安全”选项卡上单击“编辑”

-Click Add - 点击添加

-Under Locations, make sure it is pointing at your local machine, not a domain - 在“位置”下,确保它指向本地计算机,而不是域

-For the object name, enter below but replace MyAppPool with the name of your application pool... - 对于对象名称,请在下面输入,但将MyAppPool替换为应用程序池的名称...

IIS APPPOOL\\MyAppPool IIS APPPOOL \\ MyAppPool

-Set the permissions to Full, or just add Write, or whatever you need. - 将权限设置为“完全”,或者只添加“写”或任何您需要的权限。

or you can repalce APPPOOL to the name of your server or computer and with the IIS_ISURS . 或者您可以使用IIS_ISURS将APPPOOL重新命名为您的服务器或计算机的IIS_ISURS example: 例:

yourserver\IIS_IUSRS

See this Screen Shot 看这个屏幕截图

截图

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 C# 更改 IIS FTP 上的读/写权限? - How change read/write permissions on IIS FTP using C#? 从iis上托管的Web应用程序读取/写入共享驱动器中的文件 - Read/write files in shared drive from web application hosted on iis ASP.NET-我正在生成带有DLL的.XLS文件,如何授予写入文件的权限? (IIS 7) - ASP.NET - I am generating an .XLS file with a DLL, how do I grant permissions for writing to file? (IIS 7) 在 IIS 上启动 .NET Core Web API 时出错:“应用程序正在 IIS 进程内运行,但未配置为使用 IIS 服务器” - Error on starting .NET Core Web API on IIS: "Application is running inside IIS process but is not configured to use IIS server" 如何配置Web Api 2和IIS进行基本身份验证? - How to configure Web Api 2 and IIS for Basic Authentication? 是否可以在没有IIS(非Web API)的情况下自行托管MVC 4应用程序? - Is it possible to self-host a MVC 4 Application without IIS (not Web API)? 从IIS上托管的Web API打开WPF应用程序 - Open a WPF Application from Web API that is hosted on IIS Azure Web 应用程序 - 如何使用委托和应用程序权限 - Azure Web Application - how to use both delegated and Application permissions “ Web未在IIS中标记为应用程序” - “The Web is not marked as an application in IIS” Web服务混乱-IIS-如何获取网站的当前目录和权限问题 - Web Service Confusion - IIS - How to get web site's current directory and permissions issues
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM