如何反射权限添加到IIS或将其添加到web.config文件?

问题描述:

我使用 FileHelpers 的读取CSV文件和所有直到我从VS开发服务器切换到IIS也没关系,我得到的?PolicyException:必需的权限不能后天的,我用Google搜索,发现我需要添加的反射权限作为这项工作,任何人都知道如何

I'm using FileHelpers for reading csv files, and all it was ok until I switched from VS dev server to IIS, I get a "PolicyException: Required permissions cannot be acquired", I googled and found that I need to add Reflection Permission for this to work, anybody knows how ?

您asp.net应用程序在低信任或中等信任可能运行。反思权限是完全信任的。

Your asp.net application is probably running in low-trust or medium trust. Reflection permission is in full trust.

您可以启用这个特定权限的反思没有按照这个帖子由Rick施特拉尔去完全信任:

You can enable this specific Reflection Permission without going full trust by following this post by Rick Strahl :

http://www.west-wind.com/Weblog/posts/6344.aspx

请注意:如果你主持可能无法正常工作,并没有权限来覆盖一些安全设置

Note: it might not work if you're hosted and don't have permissions to override some security settings.