说明:应用程序尝试执行安全策略不允许的操作.要授予此应用程序所需的权限,请与系统管理员联系或更改应用程序在配置文件中的信任级别.
异常详细信息:System.Security.SecurityException:请求类型为“System.Security.Permissions.FileIOPermission,mscorlib,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089”的权限失败.
我的代码在本地服务器中运行正常,将其上传到服务器时会产生问题.
已经完成了以下代码,但它并不适用于我:
样品1:
- <system.web>
- <securityPolicy>
- <trustLevel name="Full" policyFile="internal"/>
- </securityPolicy>
- </system.web>
样品2:
- <location allowOverride="false">
- <system.web>
- <securityPolicy>
- <trustLevel name="Full" policyFile="internal" />
- <trustLevel name="High" policyFile="web_hightrust.config" />
- <trustLevel name="Medium" policyFile="web_mediumtrust.config" />
- <trustLevel name="Low" policyFile="web_lowtrust.config" />
- <trustLevel name="Minimal" policyFile="web_minimaltrust.config"/>
- </securityPolicy>
- </system.web>
- </location>
样品3:
- <system.web>
- <trust level="Full" originUrl="" />
- </system.web>