【发布时间】:2018-12-11 18:27:59
【问题描述】:
我已将我的插件注册为以“无”隔离模式运行的后异步插件。它在我处于调试模式时运行,但在我在目标实体“注释”上创建记录时不会从网络运行。
我想补充一点,程序集已注册以存储在数据库中。
代码:
public void Execute(IServiceProvider serviceProvider)
{
try
{
if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
{
// Obtain the target entity from the input parameters.
Entity entity = (Entity)context.InputParameters["Target"];
// Verify that the target entity represents an annotation. If not, this plug-in was not registered correctly.
if (entity.LogicalName != "annotation")
return;
tracingService.Trace("A Plugin is triggered!", "My Plugin");
}
.....
}
}
当我在调试模式下运行插件并且没有错误执行时,插件按预期工作。当我将文档附加到我的实体时,插件根本不会执行,也不会记录任何错误。
任何想法如何诊断这个?还是缺少什么?
【问题讨论】:
标签: c# dynamics-crm