Tridion.AudienceManagement.API 在初始化期间抛出异常 [英] Tridion.AudienceManagement.API throws exception during initialization

查看:30
本文介绍了Tridion.AudienceManagement.API 在初始化期间抛出异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个控制台应用程序,它在 Tridion.AudienceManagement.API API 上执行简单的操作.当我启动应用程序时,它做的第一件事是引用 UserContext.Current,此时我得到以下异常.

I have created a console application that performs simple actions on the Tridion.AudienceManagement.API API. When I start the application, the first thing it does is reference UserContext.Current, at which point I get the following exception.

The type initializer for 'Tridion.AudienceManagement.DomainModel.Utilities.Configuration' threw an exception.
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.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.API.UserContext..ctor()
at Tridion.AudienceManagement.API.UserContext.get_Current()   

我已确认 Audience Manager 已安装并在服务器上运行.

I have confirmed that Audience Manager is installed and working on the server.

通过从以 MTS 用户身份登录的 shell 运行程序,我们可以避免这个问题.起初我们认为问题在于日志文件夹的文件系统权限,但是,即使授予完全控制权也无济于事.

By running the programme from a shell logged in as the MTS User, we can avoid this problem. At first we thought the issue was with file system permissions on the log folder, however, even granting full control does not help.

当比较以两个用户身份运行代码的 procmon 输出时,我们可以看到失败的用户因为在 C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys 中创建文件而被拒绝访问 - 文件名是一长串看起来随机的字符.MtsUser 看不到此访问被拒绝.

When comparing procmon output from running the code as the two users, we could see that the user for whom it failed was getting ACCESS DENIED for creating a file within C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys - the filename is a long string of random-looking characters. This ACCESS DENIED is not seen for MtsUser.

推荐答案

似乎不允许运行控制台应用程序的用户读取用于加密配置的加密密钥.

It appears that the user running the console application is not allowed to read the encryption key which was used to encrypt the configuration.

您有几种解决方法:

  1. 删除加密(不推荐)
  2. 以有权使用密钥的用户身份运行您的工具(即 MTSUser)
  3. 向您要运行该工具的用户授予权限.例子命令行:aspnet_regiis -pa "TridionRsaProtectedConfigurationProvider" "domain\username"

(显然需要以可以读取密钥的人的身份运行——MTSUser)

(Which obviously needs to run as someone who can read the key -- MTSUser)

有关详细信息,请参阅以下 URL:

See the following URLs for more information:

  • Encrypting sensitive strings for Audience Manager (SDL LiveContent)
  • Walkthrough: Encrypting Configuration Information Using Protected Configuration (MSDN)

这篇关于Tridion.AudienceManagement.API 在初始化期间抛出异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆