2

ASP.Net 4.0 フレームワークで Web アプリケーションを作成し、データベースとのやり取りに MS-SQL を使用しています。コードをビルドし、共有 Web ホスティング サーバーにアップロードしました。そのホームページは正常に機能し、ページのコンテンツがデータベースと対話しない場合はすべてのページが正常に機能します。しかし、これらのページがデータベースと対話するページはエラーになります:

Security Exception 
Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. 

Exception Details: System.Security.SecurityException: Request failed.


Stack Trace: 

[SecurityException: Request failed.]
System.Security.CodeAccessSecurityEngine.ThrowSecurityException(RuntimeAssembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed) +165
System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed) +100
System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandleInternal rmh, Object assemblyOrString, SecurityAction action, Boolean throwException) +272
System.Security.PermissionSetTriple.CheckSetDemand(PermissionSet demandSet, PermissionSet& alteredDemandset, RuntimeMethodHandleInternal rmh) +59
System.Security.PermissionListSet.CheckSetDemand(PermissionSet pset, RuntimeMethodHandleInternal rmh) +54
System.Security.PermissionListSet.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet) +33
System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant, CompressedStack securityContext) +154
System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant) +54
System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(PermissionType permission, PermissionSet targetGrant) +29
System.Reflection.Emit.DynamicMethod.PerformSecurityCheck(Type owner, StackCrawlMark& stackMark, Boolean skipVisibility) +10540369
System.Reflection.Emit.DynamicMethod..ctor(String name, Type returnType, Type[] parameterTypes, Type owner, Boolean skipVisibility) +48
Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.CreateDynamicMethod(String name, Type returnType, Type[] parameterTypes, Type owner) +86
Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.CreateDefaultConstructor(Type type) +68
Newtonsoft.Json.Serialization.DefaultContractResolver.GetDefaultCreator(Type createdType) +37
Newtonsoft.Json.Serialization.DefaultContractResolver.InitializeContract(JsonContract contract) +257
Newtonsoft.Json.Serialization.DefaultContractResolver.CreateArrayContract(Type objectType) +40
Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract(Type objectType) +243
Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type) +105
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType) +80
Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) +47
Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) +98
Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonConverter[] converters) +71
Newtonsoft.Json.JsonConvert.DeserializeXmlNode(String value, String deserializeRootElementName) +80
Ext.Net.XControl.get_SubmitConfig() +80
Ext.Net.ResourceManager.RaisePostBackEvent(String eventArgument) +560
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9643314
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6704
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +245
System.Web.UI.Page.ProcessRequest() +72
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +58
ASP.cms_files_images_aspx.ProcessRequest(HttpContext context) +37
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +341
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929

共有サーバーでこのエラーを解決するには??

すべてのコードはローカル IIS サーバーとテスト専用サーバーで正常に動作しますが、クライアントは共有サーバーを購入し、共有サーバーで実行したいと考えています。

この問題は、共有 Web ホスティング サーバーの「セキュリティ ポリシーで許可されていない操作をアプリケーションが実行しようとしました」に投稿されたスレッドに似ています。

しかし、その解決策は LINQ with ASP.NET です。ASP.NET を使用した MSSQL のソリューションが必要です

4

1 に答える 1