亚音速 3.0 中等信任问题

发布于 2024-08-04 13:36:22 字数 2386 浏览 6 评论 0原文

我在中等信任度下运行 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"/>  

提前致谢。喜欢新的亚音速和拉姆达等,只是在部署到我的第一个共享主机时遇到问题:(

欢呼 道格

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());

and the error i'm getting is:

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"/>  

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

cheers
Doug

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

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

发布评论

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

评论(2

十年不长 2024-08-11 13:36:22

Subsonic 在共享托管场景中不起作用(无论如何,那些具有中等信任度的场景)。问题是这条线...

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

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

至少他们教我将

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

共享托管网站的任何开发包含在我的 web.config 中。

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();

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.

At least they taught me to include

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

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

贱人配狗天长地久 2024-08-11 13:36:22

编辑 - 该错误现已修复,版本 3.1 将在发布时支持中等信任,如果您从 github 提取最新版本的源代码并自己构建它,您应该会发现它现在可以在中等信任下工作。

看来您遇到了错误。如果您可以在错误报告中添加更多详细信息(例如尽可能小的测试用例),那将会很有帮助。

Edit - The bug is now fixed, version 3.1 will support medium trust when it's released and if you pull the latest version of the source from github and build it yourself you should find that it works in medium trust now.

Looks like you're coming up against this bug. If you can add some more details to the bug report such as the smallest possible test case that would be helpful.

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