Answered by:
A problem on registering the plug-in assembly, can not see the class of dll files

Question
-
Hello,
i write a plug-in but when i registering the assembly, in the step2, i can only see the name of the assembly, but there are no class, so i can not continuer...i try serveral times but ...
here is a link of the picture showing the problem
http://picasaweb.google.com/gaosongfour/CRM#5482979156726123442
thanks
Tuesday, June 15, 2010 12:47 PM
Answers
-
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- Proposed as answer by Ahmed ElNoby Tuesday, June 15, 2010 1:29 PM
- Marked as answer by DavidJennawayMVP, Moderator Monday, July 26, 2010 8:55 AM
Tuesday, June 15, 2010 1:23 PM
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); } } } } }
thanksTuesday, 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- Proposed as answer by Ahmed ElNoby Tuesday, June 15, 2010 1:29 PM
- Marked as answer by DavidJennawayMVP, Moderator Monday, July 26, 2010 8:55 AM
Tuesday, June 15, 2010 1:23 PM -
....you are right...wowowo,haha
thanks!!
Tuesday, June 15, 2010 1:29 PM