locked
A problem on registering the plug-in assembly, can not see the class of dll files RRS feed

Answers

All replies

  • Have you implemented the plugin interface?
    That would be something like:
    
    public class MyPlugin : IPlugin
    {
    public void Execute(IPluginExecutionContext context)
    {
    ..........
    ...............
    
    }
    }
    Tuesday, June 15, 2010 12:52 PM
  • yes, i implemented, now i follow the example on the book "Programming Microsoft Dynamics CRM4.0" the code is bellow, the same problem..

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Text.RegularExpressions;
    using Microsoft.Crm.Sdk;
    
    namespace ProgrammingCrm.plugin
    {
      class AccountNumberValidator:IPlugin
      {
        public void Execute(IPluginExecutionContext context)
        {
          DynamicEntity target = (DynamicEntity)context.InputParameters[ParameterName.Target];
    
          if (target.Properties.Contains("accountnumer"))
          {
            string accountnumber = (string)target["accountnumber"];
            Regex validformat = new Regex("[A-Z]{2}-[0-9]{6}");
    
            if (!validformat.IsMatch(accountnumber))
            {
              string message = "account number does not follow the required format";
    
              throw new InvalidPluginExecutionException(message);
    
            }
          }
    
        }
      }
    }
    thanks
    Tuesday, June 15, 2010 1:18 PM
  • Your class has to be public, otherwise it will not be accessible from outside assembly,

    public class AccountNumberValidator:IPlugin


    Muhammad Ali Khan
    http://malikhan.wordpress.com
    Tuesday, June 15, 2010 1:23 PM
  • ....you are right...wowowo,haha

    thanks!!

    Tuesday, June 15, 2010 1:29 PM