これは、次の質問の補足質問です: Outbound E-mail Profile API: Get list of e-mailaddresses
Audience Management API を調べるための簡単な例を書いています。私が持っているすべてのコードはここにあります。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tridion.AudienceManagement.API;
namespace OEPasswordEncrypt
{
class Program
{
static void Main(string[] args)
{
StaticAddressBook importAddressBook = new StaticAddressBook(new UserContext());
}
}
}
CM サーバーでこれを実行すると、次のようなエラーが表示されます。
Unhandled Exception: System.TypeInitializationException: The type initializer for 'Tridion.AudienceManagement.DomainModel.Utilities.Configuration' threw an exception. ---> Tridion.AudienceManagement.DomainModel.Exceptions.LocalizableConfiguationErrorsException: Loading of the configuration failed. ---> System.Configuration.ConfigurationErrorsException: The RSA key container could not be opened.
at System.Configuration.RsaProtectedConfigurationProvider.ThrowBetterException(Boolean keyMustExist)
at System.Configuration.RsaProtectedConfigurationProvider.GetCryptoServiceProvider(Boolean exportable, Boolean keyMustExist)
at System.Configuration.RsaProtectedConfigurationProvider.Decrypt(XmlNode encryptedNode)
at Tridion.AudienceManagement.DomainModel.Utilities.ConfigurationEncryption.TraverseAndProcessChildren(Dictionary`2 protectedConfigurationProviders, XmlNodenode)
at Tridion.AudienceManagement.DomainModel.Utilities.ConfigurationEncryption.DecryptConfiguration(XmlDocument rawConfiguration)
at Tridion.AudienceManagement.DomainModel.Utilities.Configuration.Reload()
--- End of inner exception stack trace ---
at Tridion.AudienceManagement.DomainModel.Utilities.Configuration.Reload()
at Tridion.AudienceManagement.DomainModel.Utilities.Configuration..cctor()
--- End of inner exception stack trace ---
at Tridion.AudienceManagement.DomainModel.Utilities.Configuration.get_LogFolder()
at Tridion.AudienceManagement.DomainModel.Utilities.Logger.AssertValidLogFolder()
at Tridion.AudienceManagement.DomainModel.Utilities.Logger.WriteLine(LogLevel logLevel, String message, Object[] objects)
at Tridion.AudienceManagement.DomainModel.Utilities.Logger.WriteLine(LogLevel logLevel, String message)
at Tridion.AudienceManagement.DomainModel.Utilities.Logger.Info(String message)
at Tridion.AudienceManagement.DomainModel.ServiceClient.ContentManagerClient.LogBindingInfo(Exception ex)
at Tridion.AudienceManagement.DomainModel.ServiceClient.ContentManagerClient.GetConfiguredCoreService()
at Tridion.AudienceManagement.DomainModel.ServiceClient.ContentManagerClient.GetClient(UserContext userContext, UserData& userData)
at Tridion.AudienceManagement.DomainModel.ServiceClient.ContentManagerClient.LoadCurrentUser(UserContext userContext, String userDataXml)
at Tridion.AudienceManagement.DomainModel.UserContext..ctor(String trusteeName)
at Tridion.AudienceManagement.DomainModel.UserContext..ctor()
at Tridion.AudienceManagement.API.UserContext..ctor()
at OEPasswordEncrypt.Program.Main(String[] args) in c:\users\kaht\documents\visual studio 2010\Projects\OEPasswordEncrypt\OEPasswordEncrypt\Program.cs:line 13
自分のユーザー名で aspnet_regiis TridionRsaKeyContainer を実行しようとしましたが、RSA キー コンテナーが存在しないことがわかります。