質問

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

事前に感謝します。新しいサブソニックやラムダなどが大好きで、最初の共有ホストへのデプロイに問題があるだけです:(

乾杯 ダグ

役に立ちましたか?

解決

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

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

現時点では、サブソニックは絶対に選択肢ではないので、3.1を待つか2.0に移行することができます。それは素晴らしいアイデアでしたが、首のひげがこの問題についてユーザーに伝えないのは悲しいことです。

少なくとも含めることを教えてくれました

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

共有ホスティングサイトの開発用のweb.configで。

他のヒント

編集-バグは修正され、バージョン3.1はリリース時に中信頼をサポートします。最新バージョンのソースをgithubから取得して自分でビルドすると、中信頼で動作することがわかります。

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top