[英]That assembly does not allow partially trusted callers although the zone is fully trusted
從昨天開始,當我想從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版的安裝有關嗎?
嘗試添加
<configuration>
<system.web>
<trust level="Full" />
</system.web>
</configuration>
到您的web.config。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.