Inheritance security rules violated while overriding member - SecurityRuleSet.Level2

前端 未结 5 2084
感动是毒
感动是毒 2020-11-27 21:24

I have a class that inherits from Exception. In .NET 4, I started receiving a runtime error:

Inheritance security rules violated while overriding m

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 21:49

    Had this problem when I was calling an assembly that had AllowPartiallyTrustedCallers attribute:

    [assembly: System.Security.AllowPartiallyTrustedCallers]
    

    Removing it solved my problem without switching to SecurityRuleSet.Level1.

提交回复
热议问题