PostgreSQLProvider in non-web hosted applications (Feature #17)
Description
I am writing a WCF service that is not hosted in IIS. In PgMembershipProvider Initialize(....) HostingEnvironment.!ApplicationVirtualPath will always be null.
Because of this WebConfigurationManager.!OpenWebConfiguration(...) will always return the machine config instead of the application config, thus never reading the
machine key settings correctly from the application's configuration.
This can be fixed by checking to see if an ApplicationVirtualPath is present or not, and then opening the application's .exe configuration.
Suggested change PgMembershipProvider.cs line 107:
Configuration cfg = null;
if (HostingEnvironment.ApplicationVirtualPath != null)
{
cfg = [[WebConfigurationManager]].OpenWebConfiguration(HostingEnvironment.ApplicationVirtualPath);
}
else
{
// hosted in an application
cfg = [[ConfigurationManager]].OpenExeConfiguration(ConfigurationUserLevel.None);
}
m_machineKeyConfig = (MachineKeySection)cfg.GetSection("system.web/machineKey");
Thanks!
Dan
Associated revisions
History
Updated by Daniel Nauck over 3 years ago
- Status changed from New to Assigned
Updated by Daniel Nauck over 3 years ago
- % Done changed from 0 to 10
- Priority changed from High to Normal
- Start date set to 01/19/2010
- Estimated time set to 1.00
Updated by Daniel Nauck over 3 years ago
- % Done changed from 10 to 100
- Due date set to 01/19/2010
Updated by Daniel Nauck over 3 years ago
Status geƤndert durch Changeset d585bf824ea375d1676168a8d84f1cf7df2577a8.
- Status changed from Assigned to Closed