表单身份验证适用于开发服务器,但不适用于生产服务器(相同的 SQL 数据库)

发布于 2024-08-20 04:28:20 字数 481 浏览 5 评论 0原文

我以前从未遇到过这个问题,我完全不知所措。

我有一个 SQL Server 2008 数据库,其中包含 ASP.NET 表单身份验证、配置文件和角色,并且已在开发工作站上运行。我可以使用创建的用户登录,没有问题。

我在开发计算机上备份数据库并在生产服务器上恢复它。我将 DLL 和 ASP.NET 文件复制到服务器。我在 web.config 中进行了必要的更改,更改 SQL 连接字符串以指向生产服务器数据库并上传它。

我已确保生成一个机器密钥,并且它在开发 web.config 和生产 web.config 上都是相同的。

然而,当我尝试登录生产服务器时,我在开发计算机上成功登录的同一用户在生产服务器上却失败了。

数据库中还有其他内容,FluentNHibernate生成的schema。该内容可以在开发服务器和生产服务器上成功查询。

这真是令人难以置信,我相信我已经验证了一切,但显然它仍然不起作用,我一定错过了一些东西。请问,有什么想法吗?

I've never had this problem before, I'm at a total loss.

I have a SQL Server 2008 database with ASP.NET Forms Authentication, profiles and roles created and is functional on the development workstation. I can login using the created users without problem.

I back up the database on the development computer and restore it on the production server. I xcopy the DLLs and ASP.NET files to the server. I make the necessary changes in the web.config, changing the SQL connection strings to point to the production server database and upload it.

I've made sure to generate a machine key and it is the same on both the development web.config and the production web.config.

And yet, when I try to login on the production server, the same user that I'm able to login successfully with on the development computer, fails on the production server.

There is other content in the database, the schema generated by FluentNHibernate. This content is able to be queried successfully on both development and production servers.

This is mind boggling, I believe I've verified everything, but obviously it is still not working and I must have missed something. Please, any ideas?

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

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

发布评论

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

评论(1

四叶草在未来唯美盛开 2024-08-27 04:28:20

我曾经遇到过类似症状的问题,因为我忘记在 web.config 的membershipProvider元素下设置applicationName属性。

  <membership defaultProvider="SqlProvider">
    <providers>
      <clear />
      <add
        name="SqlProvider"
        applicationName="MyApplication"
        ...
        />
    </providers>
  </membership>

用户与特定应用程序相关联。由于我没有设置 applicationName,因此它默认为应用程序路径(例如“/MyApplication”)。当它转移到生产环境时,路径发生了更改(例如更改为“/WebSiteFolder/SomeSubFolder/MyApplication”),因此应用程序名称默认为新的生产路径,并且无法与设置的原始用户帐户建立关联发展中。

你的问题可能和我的一样吗?

I ran into a problem with similar symptoms at one point by forgetting to set the applicationName attribute in the web.config under the membership providers element.

  <membership defaultProvider="SqlProvider">
    <providers>
      <clear />
      <add
        name="SqlProvider"
        applicationName="MyApplication"
        ...
        />
    </providers>
  </membership>

Users are associated to a specific application. Since I didn't set the applicationName, it defaulted to the application path (something like "/MyApplication"). When it was moved to production, the path changed (for example to "/WebSiteFolder/SomeSubFolder/MyApplication"), so the application name defaulted to the new production path and an association could not be made to the original user accounts that were set up in development.

Could your issues possibly be the same as mine?

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