Subsonic 3.0 中等信任问题 [英] Subsonic 3.0 Medium Trust Issue

查看:76
本文介绍了Subsonic 3.0 中等信任问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在以中等信任度运行 Subsonic 时遇到问题,不知道我是否查询错了 - 如果 subsonic 3.0.3 的某些部分不喜欢中等信任度,有人可以告诉我吗?不久前有人发布了类似的东西,但没有真正回答它是否存在(错误).Rob 说它已经过测试,而其他人说他们仍然有错误(SubSonic 3.0 - Medium Trust)

I'm having an issue with running Subsonic in medium trust and don't know if i'm querying wrong - if there is some part of subsonic 3.0.3 that doesn't like medium trust can someone tell me? Someone else posted somethin similar a while ago and there was no real reply on whether it did exist or not (the bug). Rob said it had been tested, while someone else said they still had to bug (SubSonic 3.0 - Medium Trust)

我正在使用如下所示的查询:

i'm using a query that looks like this:

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 等,只是在部署到我的第一个共享主机时遇到问题:(

Thanks in advance. Loving the new subsonic and lambda's etc, just having issues deploying to my first shared-host :(

干杯道格

推荐答案

Subsonic 不适用于共享主机方案(无论如何,具有中等信任度的方案).问题是这一行...

Subsonic WILL NOT WORK in shared hosting scenarios ( well the ones that have medium trust anyway). The problem is this line...

Func<IQueryable> fn = efn.Compile();

也许等待 3.1 或转到 2.0,因为亚音速目前绝对不是一个选择.这是个好主意,但令人遗憾的是,脖子上的胡须没有告诉他们的用户这个问题.

Maybe wait for 3.1 or go to 2.0 as subsonic is absolutely not an option at the moment. It was a great idea but it's sad the neck beards don't tell their users about this issue.

至少他们教会了我包括

<system.web>
    <trust level="Medium" />
</system.web>

在我的 web.config 中用于共享托管站点的任何开发.

in my web.config for any development for shared hosting sites.

这篇关于Subsonic 3.0 中等信任问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆