【发布时间】:2011-11-24 21:46:06
【问题描述】:
我在 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 服务器和我们的测试专用服务器上都可以正常工作,但我们的客户购买了共享服务器并希望在共享服务器上运行。
【问题讨论】:
-
请把它放在你的问题中。
标签: asp.net linq-to-sql hosting web-hosting shared-hosting