以下代码在 InitializeClientContextFromName 处失败,并显示“值不在预期范围内”。它适用于另一个开发人员的机器。
我应该跟进的任何线索?我对阿兹曼一点都不熟悉……
private List<string> SyncAzManRoles(ActiveDirectoryMembershipProvider provider)
{
List<string> userAzManRoles = new List<string>();
AzAuthorizationStoreClass store = new AzAuthorizationStoreClass();
if (store == null)
{
AuthTrace("Azman store is not available");
throw new InvalidOperationException("The azman store is not available");
}
store.Initialize(0, ConfigurationManager.ConnectionStrings
["LocalPolicyStore"].ConnectionString, null);
IAzApplication3 app = store.OpenApplication(Security.ApplicationName, null) as IAzApplication3;
if (app == null)
{
AuthTrace("Azman application is not available");
throw new InvalidOperationException("The azman application is not available");
}
IAzClientContext3 clientContext = null;
try
{
clientContext = app.InitializeClientContextFromName(_username,
provider.Name, null) as IAzClientContext3;