有人在 Rackspace 云站点上使用 SQL Compant 4 吗?

发布于 2024-12-20 08:59:25 字数 3894 浏览 2 评论 0原文

我一直在尝试在 Rackspace 云站点(不是云服务器)上部署一个轻量级站点,该站点使用 SQL CE 4 来存储简单的联系表单提交。每当我尝试访问数据库时,我总是收到无法获取必需的权限错误。

我不确定我可以做什么(如果有的话)来解决它,因为我无权访问 IIS 或此服务器模型中的计算机级配置。据我了解,SQL CE 4 应该在 ASP.NET 3.5 下以中等信任度工作,但我

这里是错误转储:

无法获取所需的权限。描述:未处理 执行当前 Web 请求期间发生异常。 请查看堆栈跟踪以获取有关错误和的更多信息 它起源于代码。

异常详细信息:System.Security.Policy.PolicyException:必需 无法获取权限。

来源错误:

执行过程中产生了未处理的异常 当前的网络请求。有关原产地和地点的信息 可以使用下面的异常堆栈跟踪来识别异常。

堆栈跟踪:

[PolicyException:无法获取所需的权限。]
System.Security.SecurityManager.ResolvePolicy(证据证据, 权限集 reqdPset、权限集 optPset、权限集拒绝Pset、 权限集&被拒绝,布尔值 checkExecutionPermission) +7606467
System.Security.SecurityManager.ResolvePolicy(证据证据, 权限集 reqdPset、权限集 optPset、权限集拒绝Pset、 权限集&被拒绝,Int32& securitySpecialFlags,布尔值 检查执行权限)+57

[FileLoadException:无法加载文件或程序集 'System.Data.SqlServerCe,版本=4.0.0.0,文化=中性, PublicKeyToken=89845dcd8080cc91' 或其依赖项之一。失败 授予最低权限请求。 (HRESULT 的异常: 0x80131417)] System.Reflection.Assembly._nLoad(AssemblyName 文件名、字符串代码库、证据程序集安全性、程序集 locationHint、StackCrawlMark& stackMark,布尔值 throwOnFileNotFound, 用于内省的布尔值)+0
System.Reflection.Assembly.nLoad(AssemblyName 文件名, String 代码库、证据组装安全性、组装位置提示、 StackCrawlMark& stackMark,布尔值 throwOnFileNotFound,布尔值 用于内省)+43
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, 证据组装安全、StackCrawlMark&堆栈标记、布尔值 用于内省)+127
System.Reflection.Assembly.InternalLoad(字符串 assemblyString, 证据组装安全、StackCrawlMark&堆栈标记、布尔值 forIntrospection) +142 System.Reflection.Assembly.Load(String 汇编字符串)+28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(字符串 assemblyName,布尔星指令)+46

[ConfigurationErrorsException:无法加载文件或程序集 'System.Data.SqlServerCe,版本=4.0.0.0,文化=中性, PublicKeyToken=89845dcd8080cc91' 或其依赖项之一。失败 授予最低权限请求。 (HRESULT 的异常: 0x80131417)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(字符串 程序集名称,布尔星指令)+613
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo 艾)+105
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig)+178
System.Web.Compilation.BuildProvidersCompiler..ctor(虚拟路径 configPath、布尔值 supportLocalization、字符串 outputAssemblyName) +54 System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(虚拟路径 virtualDir、CodeDirectoryType dirType、字符串程序集名称、StringSet exceptedSubdirectories, 布尔值 isDirectoryAllowed) +600
System.Web.Compilation.BuildManager.CompileCodeDirectory(虚拟路径 virtualDir、CodeDirectoryType dirType、字符串程序集名称、StringSet 排除的子目录)+125
System.Web.Compilation.BuildManager.CompileCodeDirectories() +265
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +320

[HttpException (0x80004005): 无法加载文件或程序集 'System.Data.SqlServerCe,版本=4.0.0.0,文化=中性, PublicKeyToken=89845dcd8080cc91' 或其依赖项之一。失败 授予最低权限请求。 (HRESULT 的异常: 0x80131417)]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager 应用程序管理器、IApplicationHost 应用程序主机、IConfigMapPathFactory configMapPathFactory、HostingEnvironmentParameters (hostingParameters) +729

[HttpException (0x80004005): 无法加载文件或程序集 'System.Data.SqlServerCe,版本=4.0.0.0,文化=中性, PublicKeyToken=89845dcd8080cc91' 或其依赖项之一。失败 授予最低权限请求。 (HRESULT 的异常: 0x80131417)] System.Web.HttpRuntime.FirstRequestInit(HttpContext 上下文)+8901019
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext上下文)+85 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr,HttpContext 上下文)+333

I've been trying to deploy a lightweight site on a Rackspace Cloud Site (not a Cloud Server) that uses SQL CE 4 to store simple contact-form submissions. I keep getting the Required permissions cannot be acquired error whenever I try to access the database.

I'm not sure what I can do (if anything) to resolve it since I don't have access to IIS or the machine-level config in this server model. As I unerstand it, SQL CE 4 is supposed to work in medium trust under ASP.NET 3.5, but I

Here's the error dump:

Required permissions cannot be acquired. Description: An unhandled
exception occurred during the execution of the current web request.
Please review the stack trace for more information about the error and
where it originated in the code.

Exception Details: System.Security.Policy.PolicyException: Required
permissions cannot be acquired.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.

Stack Trace:

[PolicyException: Required permissions cannot be acquired.]
System.Security.SecurityManager.ResolvePolicy(Evidence evidence,
PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
PermissionSet& denied, Boolean checkExecutionPermission) +7606467
System.Security.SecurityManager.ResolvePolicy(Evidence evidence,
PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
PermissionSet& denied, Int32& securitySpecialFlags, Boolean
checkExecutionPermission) +57

[FileLoadException: Could not load file or assembly
'System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91' or one of its dependencies. Failed to
grant minimum permission requests. (Exception from HRESULT:
0x80131417)] System.Reflection.Assembly._nLoad(AssemblyName
fileName, String codeBase, Evidence assemblySecurity, Assembly
locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound,
Boolean forIntrospection) +0
System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Evidence assemblySecurity, Assembly locationHint,
StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean
forIntrospection) +43
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection) +127
System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection) +142 System.Reflection.Assembly.Load(String
assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +46

[ConfigurationErrorsException: Could not load file or assembly
'System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91' or one of its dependencies. Failed to
grant minimum permission requests. (Exception from HRESULT:
0x80131417)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +613
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()
+203 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo
ai) +105
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection
compConfig) +178
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath
configPath, Boolean supportLocalization, String outputAssemblyName)
+54 System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath
virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet
excludedSubdirectories, Boolean isDirectoryAllowed) +600
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath
virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet
excludedSubdirectories) +125
System.Web.Compilation.BuildManager.CompileCodeDirectories() +265
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +320

[HttpException (0x80004005): Could not load file or assembly
'System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91' or one of its dependencies. Failed to
grant minimum permission requests. (Exception from HRESULT:
0x80131417)]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()
+58 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
appManager, IApplicationHost appHost, IConfigMapPathFactory
configMapPathFactory, HostingEnvironmentParameters hostingParameters)
+729

[HttpException (0x80004005): Could not load file or assembly
'System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91' or one of its dependencies. Failed to
grant minimum permission requests. (Exception from HRESULT:
0x80131417)] System.Web.HttpRuntime.FirstRequestInit(HttpContext
context) +8901019
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest
wr, HttpContext context) +333

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌无敌 2024-12-27 08:59:25

SQL Server Compact 仅适用于开箱即用的 ASP.NET 4.0 中的信任,不适用于 3.5 SP1。需要修改 machine.config 以使用 3.5 SP1 和中等信任 - 我的博客文章中的更多信息如下:http://erikej.blogspot.com/2011/10/sql-server-compact-40-under-aspnet.html

SQL Server Compact only works with Medium Trust out of the box with ASP.NET 4.0, not with 3.5 SP1. The machine.config needs to be modified to work with 3.5 SP1 and medium trust - more info in my blog post here: http://erikej.blogspot.com/2011/10/sql-server-compact-40-under-aspnet.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文