请求类型“System.Security.Permissions.FileIOPermission.. 的权限失败 [英] Request for the permission of type 'System.Security.Permissions.FileIOPermission.. failed

查看:51
本文介绍了请求类型“System.Security.Permissions.FileIOPermission.. 的权限失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在调用写入 Windows 2003 本地驱动器上的文件的 Web 服务方法时,我收到此错误.

I am getting this error when calling a web service method which writes to a file on the local drive on Windows 2003.

System.Security.SecurityException:请求类型为System.Security.Permissions.FileIOPermission、mscorlib、Version=2.0.0.0、Culture=neutral、PublicKeyToken=b77a5c561934e089"的权限失败."

"System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."

我已完成以下步骤:

  • 网站使用 localSystem 身份在 appPool 中运行
  • 网站冒充管理员组中的用户.
  • Web 服务程序集完全信任
  • Web 服务的 url 完全信任机器的 web.config.
  • 写入安全性的文件夹中有被模拟的用户

那么为什么这个 Web 服务仍然抱怨 FileIOPermission?Fulltrust 包括 FileIOPermission.

So why is this web service still complaining about FileIOPermission? Fulltrust includes FileIOPermission.

推荐答案

经过大量故障排除后,归结为我在 web.config 中犯的一个错误,其中位置标签的路径为 www.example.com 但在IIS 是example.com!

After a lot of troubleshooting, it boiled down to a mistake I made in web.config where the location tag had a path of www.example.com but in IIS it was example.com!

这篇关于请求类型“System.Security.Permissions.FileIOPermission.. 的权限失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆