AspNetPgSqlMembershipProvider configuration issue
Posted: Fri 14 Oct 2011 20:52
I have an application that runs as a Windows service which needs to make calls to the DevArt ASPNET Membership provider. I've got an app.config file in the project with the following content:
I took most of the file's contents from the app.config for another program I have that uses this same code and just tweaked it as necessary.
To test the code, we have a number of unit tests set up. I am debugging the code in the service through the unit test. To be clear, the app.config file is in the service project, not the test project. The module being tested has a property called CurrentUserName, which is included below:
When I single step through the code, a FileNotFound exception is thrown on the "MembershipUser user = Membership.GetUser( iCurrentUserName );" line.
I checked the properties on the Devart.Data.PostgreSql.Web.dll file and they are set to Copy if newer. Is something wrong with my app.config or is it some other problem?
Tony[/quote]
Code: Select all
To test the code, we have a number of unit tests set up. I am debugging the code in the service through the unit test. To be clear, the app.config file is in the service project, not the test project. The module being tested has a property called CurrentUserName, which is included below:
Code: Select all
public string CurrentUserName {
get { return iCurrentUserName; }
set {
iCurrentUserName = value;
if ( ! string.IsNullOrEmpty( iCurrentUserName ) && ! string.IsNullOrWhiteSpace( iCurrentUserName ) ) {
MembershipUser user = Membership.GetUser( iCurrentUserName );
if ( user == null ) {
Log( string.Format( "User \"{0}\" is not a registered user. Cannot proceed with this user.", CurrentUserName ), EventTypeEnum.Error );
// Set the current user name to the empty string and the current domain ID to null
iCurrentUserName = string.Empty;
CurrentDomainId = null;
}
if ( user.IsLockedOut ) {
string msg = string.Format( "User \"{0}\" is currently locked out. Cannot proceed with this user.", CurrentUserName );
Log( msg, EventTypeEnum.Error );
iCurrentUserName = string.Empty;
CurrentDomainId = null;
}
CurrentUser = CarSystemUser.Attach( user, true );
UserProfile = CurrentUser.UserProfile;
UserProfile.Save();
CurrentDomainId = UserProfile.DomainId;
}
}
}
I checked the properties on the Devart.Data.PostgreSql.Web.dll file and they are set to Copy if newer. Is something wrong with my app.config or is it some other problem?
Tony[/quote]