繁体   English   中英

注册插件时出现Dynamics Crm 2011错误

[英]Dynamics Crm 2011 error while registering the plugin

我完全不熟悉crm 2011的这个插件部分。

我写了一个简单的plugin.Generate一个xrm.cs文件并尝试注册该插件,但它给出了一些“超时异常”。后来,我从解决方案中删除了Xrm.cs文件,然后该插件被注册了。 我不明白为什么会这样。

以下是我的简单插件代码,由于我删除了Xrm.cs文件,因此未被调用。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using Microsoft.Xrm.Sdk;
using System.Runtime.Serialization;




namespace NewPlugin
{
public class Plugin : IPlugin
{
    /// <summary>
    /// A plugin that creates a follow-up task activity when a new account is created.
    /// </summary>
    /// <remarks>Register this plug-in on the Create message, account entity,
    /// and asynchronous mode.
    /// </remarks>
    public void Execute(IServiceProvider serviceProvider)
    {
        //Extract the tracing service for use in debugging sandboxed plug-ins.
        ITracingService tracingService =
            (ITracingService)serviceProvider.GetService(typeof(ITracingService));
        account 
        // Obtain the execution context from the service provider.
        IPluginExecutionContext context = (IPluginExecutionContext)
            serviceProvider.GetService(typeof(IPluginExecutionContext));

        // The InputParameters collection contains all the data passed in the message request.
        if (context.InputParameters.Contains("Target") &&
            context.InputParameters["Target"] is Entity)
        {
            // Obtain the target entity from the input parameters.
            Entity entity = (Entity)context.InputParameters["Target"];

            throw new InvalidPluginExecutionException("not Possible");

        }
    }
}
}

如果有人可以告诉我Xrm.cs文件出了什么问题,那将有很大帮助。

这是我在帐户页面上单击创建按钮的onclick例外

Unhandled Exception:    System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: An error occurred. Contact a system administrator or refer to the Microsoft Dynamics CRM SDK troubleshooting guide.Detail: 
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ErrorCode>-2147220891</ErrorCode>
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
<KeyValuePairOfstringanyType>
  <d2p1:key>OperationStatus</d2p1:key>
  <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">0</d2p1:value>
</KeyValuePairOfstringanyType>
</ErrorDetails>
<Message>An error occurred. Contact a system administrator or refer to the Microsoft Dynamics CRM SDK troubleshooting guide.</Message>
<Timestamp>2013-10-28T04:51:39.2540481Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText>

[ActivityFeeds.Plugins: ActivityFeeds.Plugins.ActivityClose]
[34685442-783d-e311-a318-b4b52f6727c4: ActivityFeeds.Plugins.ActivityClose: Create of account]

可能您不是Deployment Manager(可以在crm org manager中检查它),并且该插件未在隔离模式下注册。 您可以尝试将crm开发人员工具箱安装在sdk(SDK \\ Tools \\ DeveloperToolkit)中,以简化部署/注册。 这将允许使用包,插件项目创建新的解决方案,并且如果连接到正确的crm和解决方案,您将能够让VS为您创建基类。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM