1

We have the following project/code structure:

  • ProjectA is an MVC3 project that uses Forms authentication with the ASP.NET membership provider to authenticate users onto it. It is currently only using membership and role configurations and not profile. It has the relevant web.config sections to configure this
  • ProjectB is a WCF service that makes use of the same authentication mechanism and does so by having the following
    • the same loginUrl attribute as ProjectA
    • the name attribute of the forms tag is set to ".ASPXFORMSAUTH" on both projects
    • the machineKey element under system.web is set to the same value on both projects
    • note: the web.config for ProjectB doesn't contain the ASP.NET membership configuration elements.

When code in ProjectA calls the WCF in ProjectB it passes the cookie details on the header of the call so that the WCF service can be correctly authenticated. (as described in detail in my prior question here when I was originally coding it - MVC3 Application using Forms Authentication consuming WCF in other solutions).

This approach is working fine on development and test servers in-house as described above.

However, on a client install (on the same server setup - Server 2008 with IIS 7.5) it will only work with us having to add the ASP.NET membership configuration elements into the web.config for ProjectB (the WCF service). If we don't do that then ProjectB is picking up the default (sample) ASP.NET membership configuration elements from the machine.config and then complaining about a connection string that doesn't exist (because they're only sample ones in there). The machine.configs have the same entries in on our development and test servers in-house but the same issue isn't seen.

Has anyone seen this before and knows how we can stop ProjectB looking for entries in the machine.config?

Thanks

Community
  • 1
  • 1
trembler2003
  • 559
  • 2
  • 8
  • 16

0 Answers0