我在中等信任模式下运行Subsonic有一个问题,不知道我是否查询错了--如果subsonic 3.0.3的某些部分不喜欢中等信任,有人能告诉我吗?不久前,另一个人发布了类似的帖子,并没有关于它是否存在的真正回复( bug)。Rob说它已经测试过了,而另一个人说他们仍然需要bug (SubSonic 3.0 - Medium Trust)
我使用的查询如下所示:
List<Data.Blog> objBlogPosts = ((from blog in db.Blogs
orderby blog.blogID descending
select blog).Take(10).ToList());我得到的错误是:
System.MethodAccessException:
System.Runtime.CompilerServices.StrongBox`1..ctor(System.__Canon) --->
System.Security.SecurityException: Request failed.
at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Object assemblyOrString, SecurityAction action, Boolean throwException)
at System.Security.PermissionSetTriple.CheckSetDemand(PermissionSet demandSet, PermissionSet& alteredDemandset, RuntimeMethodHandle rmh)
at System.Security.PermissionListSet.CheckSetDemand(PermissionSet pset, RuntimeMethodHandle rmh)
at System.Security.PermissionListSet.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet)
at System.Threading.CompressedStack.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet)
at System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant, CompressedStack securityContext)
at System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant)
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.PermissionSet
The demand was for:
<PermissionSet class="System.Security.PermissionSet"
version="1"
Unrestricted="true"/> 提前谢谢。喜欢新的subsonic和lambda等,只是在部署到我的第一个共享主机上有问题:(
干杯道格
发布于 2010-07-10 03:57:24
Subsonic将不会在共享主机场景中工作(好吧,那些有中等信任的场景)。问题是这条线。
Func<IQueryable> fn = efn.Compile();也许等待3.1或2.0,因为亚音速目前绝对不是一个选择。这是一个很好的想法,但遗憾的是,脖子上的胡子并没有告诉他们的用户这个问题。
至少他们教会我包括
<system.web>
<trust level="Medium" />
</system.web>在我的web.config中用于任何共享主机站点的开发。
发布于 2009-09-17 13:40:37
编辑-错误现在已经修复,3.1版本发布后将支持中等信任,如果你从github上拉出最新版本的源代码并自己构建,你会发现它现在在中等信任下工作。
看起来你遇到了this bug。如果您可以在bug报告中添加更多细节,比如最小的测试用例,这将是很有帮助的。
https://stackoverflow.com/questions/1438336
复制相似问题