窗体身份验证的工作原理开发服务器而不是生产服务器(同一个SQL数据库)上的 [英] Forms Authentication works on dev server but not production server (same SQL db)

查看:107
本文介绍了窗体身份验证的工作原理开发服务器而不是生产服务器(同一个SQL数据库)上的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前从未有过这个问题,我在全盘损失。

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

我有一个SQL Server 2008数据库与ASP.NET窗体身份验证,配置文件和创建的角色,是开发工作站上的功能。我可以登录使用创建的用户没有问题。

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.

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

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.

我已确认,以产生计算机密钥,它是在发展的web.config和生产的web.config都相同。

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.

有在数据库中,由FluentNHibernate生成架构的其他内容。此内容能够被开发和生产服务器上成功查询。

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.config中applicationName属性的成员资格提供元素。

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>

用户关联到一个特定的应用程序。由于我没有设置的applicationName,它默认为应用程序的路径(像/ MyApplication的)。当它被转移到生产,路径改变(例如,以/ WebSiteFolder / SomeSubFolder / MyApplication的),这样的应用程序名称默认为新的生产路径和关联不能以分别设置的原始用户帐户制成在开发中。

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?

这篇关于窗体身份验证的工作原理开发服务器而不是生产服务器(同一个SQL数据库)上的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆