2

中程度の信頼でSubsonicを実行する際に問題が発生し、クエリが間違っているかどうかわかりません-中程度の信頼を嫌うsubsonic 3.0.3の一部がある場合、誰かに教えてもらえますか?他の誰かが少し前に似たようなものを投稿しましたが、それが存在するかどうかについての実際の回答はありませんでした(バグ)。ロブはそれがテストされたと言いましたが、他の誰かがまだバグが必要だと言いました(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"/>  

前もって感謝します。新しい亜音速やラムダなどが大好きで、最初の共有ホストへのデプロイに問題があります:(

乾杯ダグ

4

2 に答える 2

1

編集-バグが修正されました。バージョン3.1は、リリース時に中程度の信頼をサポートします。最新バージョンのソースをgithubからプルして自分でビルドすると、中程度の信頼で機能するようになります。

このバグに直面しているようです。役立つ最小のテストケースなど、バグレポートにさらに詳細を追加できる場合。

于 2009-09-17T13:40:36.863 に答える
1

Subsonicは、共有ホスティングシナリオ(とにかく中程度の信頼があるシナリオ)では機能しません。問題はこの行です...

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

現時点では亜音速は絶対に選択できないため、3.1を待つか2.0に進むかもしれません。それは素晴らしいアイデアでしたが、首のあごひげがこの問題についてユーザーに伝えないのは悲しいことです。

少なくとも彼らは私に含めるように教えてくれました

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

共有ホスティングサイトの開発については、私のweb.configにあります。

于 2010-07-09T19:57:23.850 に答える