[英]That assembly does not allow partially trusted callers although the zone is fully trusted
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: 从昨天开始,当我想从VS.NET 2008中运行单元测试时,我收到一个安全异常。错误如下所示:
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. S:驱动器是一个映射的驱动器,它指向磁盘上的物理位置。
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.
为了使它起作用,我使用caspol实用程序创建了一个新的安全区域,以使此S:网络共享驱动器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:/.... 我刚刚添加了1.2.5区域,因为给出了错误,提到了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 ? 可能与VS.NET 2010或.NET Framework 4.0版的安装有关吗?
Try adding 尝试添加
<configuration>
<system.web>
<trust level="Full" />
</system.web>
</configuration>
to your web.config. 到您的web.config。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.