尽管该区域是完全受信任的,但该程序集不允许部分受信任的调用者
从昨天开始,当我想在 VS.NET 2008 中运行单元测试时,我收到了安全异常。 错误如下:
SecurityException: that assembly does not allow partially trusted callers
...
The assembly that failed was : file:///S:/MyProject/MyAssembly.dll
S: 驱动器是一个映射驱动器,它指向我的磁盘上的物理位置。
我觉得很奇怪的是,这在几个月前就一直有效。我的意思是,我一直这样做。 为了使其正常工作,我使用 caspol 实用程序创建了一个新的安全区域,以便为该 S: 网络共享驱动器提供 FullTrust。 换句话说,当我运行时,
caspol -m -lg
我看到了这个(为了简洁起见,我删除了其他区域):
1.2. Zone - Intranet: LocalIntranet
1.2.1. All code: Same site Web
1.2.2. All code: Same directory FileIO - 'Read, PathDiscovery'
1.2.3. Url - file://R:/*: FullTrust
1.2.4. Url - file://S:/*: FullTrust
1.2.5. Url - file:///S:/*: FullTrust
我最近添加了 1.2.5 区域,因为给出的错误提到了 file:///s:/ ....
有什么想法吗?
这是否与安装 VS.NET 2010 或 .NET Framework 4.0 版本有关?
Since yesterday, I receive a security exception when I want to run a unit-test from within VS.NET 2008.
The error goes like this:
SecurityException: that assembly does not allow partially trusted callers
...
The assembly that failed was : file:///S:/MyProject/MyAssembly.dll
The S: drive is a mapped drive which points to a physical location on my disk.
What I find very strange, is that this used to work for months previously. I mean, I did this all the time.
In order to get this to work, I 've created a new security zone with the caspol utility in order to give this S: network share drive FullTrust.
In other words, when I run
caspol -m -lg
I see this (I removed the other zones for the sake of brevity):
1.2. Zone - Intranet: LocalIntranet
1.2.1. All code: Same site Web
1.2.2. All code: Same directory FileIO - 'Read, PathDiscovery'
1.2.3. Url - file://R:/*: FullTrust
1.2.4. Url - file://S:/*: FullTrust
1.2.5. Url - file:///S:/*: FullTrust
I've added the 1.2.5 zone just recently because the error that was given, mentionned file:///s:/....
Any ideas ?
Could it be that this has something to do with the installation of VS.NET 2010 or the .NET Framework version 4.0 ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试添加
到您的 web.config。
Try adding
to your web.config.