For people using Client Application Services with WPF, be aware of this bug.
You can configure the "cache time out" for roles to be fetched again from the service.
(In the visual studio dialog, Properties -> Services -> Advanced)
This means the roles are cached on the client (in a file).
If the application asks for roles again, they are not fetched again for "cache time out" time.
When you set this value, it goes into your App.config, transformed into seconds.
So if you choose 1 minute, the App.config has: cacheTimeout="60".
However, when using the ClientRoleProvider (for instance to do something like clientRoleProvider.GetRolesForUser("SomeUser")),
this cacheTimeOut is interpreted in Minutes, not seconds!
To prove my point, check ClientRoleProvider.Initialize method:
string temp = config["cacheTimeout"];
_CacheTimeout = int.Parse(temp, CultureInfo.InvariantCulture);
Later on, in ClientRoleProvider.GetRolesFromDBUser (what's in a name?), you see:
_CacheExpiryDate = cd.RolesCachedDateUtc.AddMinutes(_CacheTimeout);
Testing also shows this behavior.
So be aware, and always put the value in minutes in your App.Config!
View Complete Post