中等信任一瞥

发布于 2024-11-14 19:20:26 字数 2472 浏览 3 评论 0 原文

有没有办法让 Glimpse 在 Medium Trust 中工作?

如果我在 web.config 中设置 ,我会收到安全异常:

   [SecurityException: Request failed.]
   System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
   System.Security.CodeAccessSecurityEngine.Check(PermissionSet permSet, StackCrawlMark& stackMark) +31
   System.Security.PermissionSet.Demand() +68
   System.Security.CodeAccessSecurityEngine.CheckGrantSetHelper(PermissionSet grantSet) +57
   System.Reflection.Emit.AssemblyBuilder.nCreateDynamicAssembly(AppDomain domain, AssemblyName name, Evidence identity, StackCrawlMark& stackMark, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, Byte[] securityRulesBlob, Byte[] aptcaBlob, AssemblyBuilderAccess access, DynamicAssemblyFlags flags, SecurityContextSource securityContextSource) +0
   System.Reflection.Emit.AssemblyBuilder..ctor(AppDomain domain, AssemblyName name, AssemblyBuilderAccess access, String dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, StackCrawlMark& stackMark, IEnumerable`1 unsafeAssemblyAttributes, SecurityContextSource securityContextSource) +198
   System.Reflection.Emit.AssemblyBuilder.InternalDefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access, String dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, StackCrawlMark& stackMark, IEnumerable`1 unsafeAssemblyAttributes, SecurityContextSource securityContextSource) +125
   System.AppDomain.InternalDefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access, String dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, StackCrawlMark& stackMark, IEnumerable`1 assemblyAttributes, SecurityContextSource securityContextSource) +43
   System.AppDomain.DefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access) +42
   System.ComponentModel.Composition.MetadataViewGenerator..cctor() +257

据我所知,该错误类似于 此处。基本上,当应用程序在中等信任度下运行时,MEF 无法完成填充实现特定接口的元数据实例的技巧。

Is there any way to get Glimpse to work in Medium Trust?

If I set <glimpse enabled="true"/> in my web.config, I get a Security Exception:

   [SecurityException: Request failed.]
   System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
   System.Security.CodeAccessSecurityEngine.Check(PermissionSet permSet, StackCrawlMark& stackMark) +31
   System.Security.PermissionSet.Demand() +68
   System.Security.CodeAccessSecurityEngine.CheckGrantSetHelper(PermissionSet grantSet) +57
   System.Reflection.Emit.AssemblyBuilder.nCreateDynamicAssembly(AppDomain domain, AssemblyName name, Evidence identity, StackCrawlMark& stackMark, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, Byte[] securityRulesBlob, Byte[] aptcaBlob, AssemblyBuilderAccess access, DynamicAssemblyFlags flags, SecurityContextSource securityContextSource) +0
   System.Reflection.Emit.AssemblyBuilder..ctor(AppDomain domain, AssemblyName name, AssemblyBuilderAccess access, String dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, StackCrawlMark& stackMark, IEnumerable`1 unsafeAssemblyAttributes, SecurityContextSource securityContextSource) +198
   System.Reflection.Emit.AssemblyBuilder.InternalDefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access, String dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, StackCrawlMark& stackMark, IEnumerable`1 unsafeAssemblyAttributes, SecurityContextSource securityContextSource) +125
   System.AppDomain.InternalDefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access, String dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, StackCrawlMark& stackMark, IEnumerable`1 assemblyAttributes, SecurityContextSource securityContextSource) +43
   System.AppDomain.DefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access) +42
   System.ComponentModel.Composition.MetadataViewGenerator..cctor() +257

From what I can tell, the error is similar to the one described here. Basically, MEF isn't able to do its trick of populating a meta-data instance implementing a particular interface when the app is running in Medium Trust.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

衣神在巴黎 2024-11-21 19:20:26

不幸的是,目前 Glimpse 需要完全信任,您可以向他们提交增强请求,大多数功能应该也可在 Medium Trust 中使用。

Unfortunately currently Glimpse requires Full Trust, you could file an enhancement request with them, most features should be available in Medium Trust as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文