【发布时间】:2013-07-10 21:42:24
【问题描述】:
我试图在网络驱动器上的 exe 中使用反射调用方法,但出现以下异常。
[2013-07-12 11:58:54 AM] 发生以下错误:异常有 被调用的目标抛出。内部异常 :System.Security.SecurityException: 请求类型的权限 'System.Security.Permissions.FileIOPermission, mscorlib, 版本=2.0.0.0,文化=中性,PublicKeyToken=b77a5c561934e089' 失败的。在 System.Security.CodeAccessSecurityEngine.Check(对象 需求,StackCrawlMark& stackMark,布尔 isPermSet)在 System.Security.CodeAccessPermission.Demand() 在 System.IO.FileStream.Init(String path, FileMode mode, FileAccess 访问、Int32 权限、布尔用户权限、FileShare 共享、Int32 bufferSize,FileOptions 选项,SECURITY_ATTRIBUTES secAttrs,字符串 msgPath, Boolean bFromProxy) 在 System.IO.FileStream..ctor(String 路径、FileMode 模式、FileAccess 访问、FileShare 共享、Int32 bufferSize,FileOptions 选项)在 System.IO.StreamWriter.CreateFile(字符串路径,布尔附加)在 System.IO.StreamWriter..ctor(字符串路径,布尔附加,编码 编码,Int32 bufferSize) 在 System.IO.StreamWriter..ctor(String 路径,布尔附加,编码编码)在 System.IO.File.AppendAllText(字符串路径,字符串内容,编码 编码)在 System.IO.File.AppendAllText(字符串路径,字符串 内容)在 ccc.ControllerBO.ExecuteTest()
我已阅读安全设置,但我不想安装调用程序 EXE 并且找不到解决方案。
我能做些什么来克服这个问题?
【问题讨论】:
标签: c# security reflection