- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Assembly 'Foo.BAL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is marked with the AllowPartiallyTrustedCallersAttribute, and uses the level 2 security transparency model. Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default, which may be the cause of this exception.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
我有一个调用我的数据访问层的标准业务层,为什么我在使用 MVC 2 和 .NET 4.0 时会收到此错误?
我之前使用的是 Enterprise Block,所以我放弃了它,现在只使用标准的 System.Data.SqlClient API 来最大限度地减少依赖性。
编辑:如果我将 BAL 和 DAL 项目上的目标框架更改为 3.5,我不会收到错误。
最佳答案
安全模型在 .NET 3.5 和 .NET 4 之间发生了相当大的变化。
关于c# - MVC 2 和 .NET 4.0 的 AllowPartiallyTrustedCallersAttribute 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3368254/
我有一个标有 AllowPartiallyTrustedCallersAttribute 的程序集,其中包含一个自定义异常类。我想通过覆盖 GetObjectData 使其可序列化。 在 .NET 4
Assembly 'Foo.BAL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is marked with the AllowPa
我是一名优秀的程序员,十分优秀!