我在ASP.Net 4.0框架中創建了一個Web應用程序,並使用LinqtoSQL進行數據庫交互。我已經構建了我的代碼並上傳到了我的共享虛擬主機服務器上。它的主頁工作正常,所有頁面都能正常工作,頁面內容不會與數據庫交互。但其頁面交互的數據庫這些頁面給我的錯誤:「應用程序試圖執行安全策略不允許的操作」共享虛擬主機服務器
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.]
DataContextFactory.GetWebRequestScopedDataContextInternal(Type type, String key, String connectionString) in DataContextFactory.cs:81
DataContextFactory.GetWebRequestScopedDataContext() in DataContextFactory.cs:42
members_buyer_mypostedjobs..ctor() in mypostedjobs.aspx.cs:19
ASP.members_buyer_mypostedjobs_aspx..ctor() in App_Web_soaq30qq.4.cs:0
__ASP.FastObjectFactory_app_web_soaq30qq.Create_ASP_members_buyer_mypostedjobs_aspx() in App_Web_soaq30qq.9.cs:0
System.Web.Compilation.BuildResultCompiledType.CreateInstance() +32
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +109
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +31
System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path) +37
System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +334
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
如何解決這個錯誤我們共享的服務器上?
所有代碼在我們的本地IIS服務器和我們的測試專用服務器上都正常工作,但我們的客戶購買了共享服務器並希望在共享服務器上運行。
什麼是堆棧跟蹤? – SLaks
請把它放在你的問題。 – SLaks