我一直在使用 Secure Store 时遇到问题。当我部署或执行 IISRESET 时,我的 Secure Store 工作了几个小时,但随后 Secure Store 死机,我得到以下错误:
System.ServiceModel.EndpointNotFoundException: Secure Store Service did not
performed the operation.
System.ServiceModel.EndpointNotFoundException: Secure Store Service did not
performed the operation. at Microsoft.Office.SecureStoreService.Server.
SecureStoreServiceApplicationProxy.Execute[T](String operationName, Boolean
validateCanary, ExecuteDelegate`1 operation) at icrosoft.Office.SecureStoreService.
Server.SecureStoreServiceApplicationProxy.GetCredentials(Guid rawPartitionId,
String applicationId) at
Microsoft.Office.SecureStoreService.Server.SecureStoreProvider.
GetCredentials(String appId)
我的选择已经不多了,这就是我在这里问的原因。
我已经研究过 Nulling 对象......从我在这里读到的内容:http: //davidlozzi.com/tag/secure-store-service/
这是我检索我的安全存储凭据的代码..
public static Dictionary<string, string> GetCredentials(string applicationID)
{
var credentialMap = new Dictionary<string, string>();
var serviceContext = SPServiceContext.Current;
var secureStoreProvider = new SecureStoreProvider { Context = serviceContext };
using (var credentials = secureStoreProvider.GetCredentials(applicationID))
{
var fields = secureStoreProvider.GetTargetApplicationFields(applicationID);
for (var i = 0; i < fields.Count; i++)
{
var field = fields[i];
var credential = credentials[i];
var decryptedCredential = ToClrString(credential.Credential);
credentialMap.Add(field.Name, decryptedCredential);
credentials[i].Dispose();
}
}
serviceContext = null;
secureStoreProvider = null;
return credentialMap;
}
..但它似乎也不起作用。
任何建议都会非常有帮助。谢谢!