我在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