开发者

Forms Authentication works on dev server but not production server (same SQL db)

开发者 https://www.devze.com 2022-12-19 04:40 出处:网络
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 worksta

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开发者_JAVA技巧 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?


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消