ASP 成员资格无法处理 web.config 中的加密连接字符串

发布于 2024-07-12 07:56:10 字数 841 浏览 9 评论 0原文

我们在拥有的测试 Web 服务器上使用其中一种 Web 方法时遇到错误。 主要错误是:

"Access to the path 'E:\websites\Discovery\ProfileService\App_Data' is denied"

进一步查看堆栈跟踪会提供更多信息:

"at System.Web.DataAccess.SqlConnectionHelper.CreateMdfFile..."
"at System.Web.DataAccess.SqlConnectionHelper.EnsureSqlExpressDBFile..."
"at System.Web.DataAccess.SqlConnectionHelper.GetConnection..."
"at System.Web.Security.SqlMembershipProvider.GetUser..."
"at System.Web.Security.Membership.GetUser..."
"at System.Web.Security.Membership.GetUser..."

会员资格提供程序似乎正在尝试查找会员资格调用的连接字符串。 在找不到此条目时,它尝试创建一个新的本地成员资格数据库,但由于权限错误而失败。

我们仔细检查了连接字符串,尽管它们已加密,但它们看起来没问题。 然后,我们保存了配置,其中连接字符串部分已解密 - 调用现在可以正常工作了!

我们知道连接字符串是正确的,因为其他服务方法工作正常。 更奇怪的是,会员资格的某些方面似乎可以通过适当的加密来实现。

有没有人以前见过这个或者知道如何使用加密的连接字符串来实现这个工作?

We were experiencing errors with one of our web methods on a test web server we have. The main error was:

"Access to the path 'E:\websites\Discovery\ProfileService\App_Data' is denied"

Looking further down the stack trace gives a little more info:

"at System.Web.DataAccess.SqlConnectionHelper.CreateMdfFile..."
"at System.Web.DataAccess.SqlConnectionHelper.EnsureSqlExpressDBFile..."
"at System.Web.DataAccess.SqlConnectionHelper.GetConnection..."
"at System.Web.Security.SqlMembershipProvider.GetUser..."
"at System.Web.Security.Membership.GetUser..."
"at System.Web.Security.Membership.GetUser..."

It appeared that the membership provider was trying to find a connection string for a membership call. On failing to find this entry, it tried to create a new local membership database and failed to do this with a permissions error.

We double checked the connection strings and they seemed ok though they were encrypted. We then saved the config with the connection strings section decrypted - the call now worked!

We know that the connection strings were correct because other service methods were working fine. What is even stranger is that some aspects of membership seemed to work with encryption in place.

Has anyone seen this before or know how to make this work with encrypted connection strings?

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

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

发布评论

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

评论(1

塔塔猫 2024-07-19 07:56:10

在你的代码中,在进行 SQL 调用之前,你是否解密了连接字符串?

堆栈跟踪中的错误可能是您的应用程序在该目录中没有写入权限。

In your code, before you make a SQL call are you decrypting the connection strings?

The error from the stack trace is likely that your app doesn't have write permission in that directory.

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