2008-04-30

How to register a Plugin inside MS CRM 4.0 using Registration tool shipped with Crm Sdk 4.0


Plugins on CRM 4.0 replaces Callouts on CRM 3.0.. Mainly Plugins/Callouts is a custom code that should run to response for an action taken place against specific entity. actions like : Create / Update... and so on. Plugins can response to more events than Callouts.. the more events mean more complexity on registering Plugins if we comparing it with Callouts. Thanks for MS, MS released a registration tool with CRM Sdk 4.0 to make out life easier. I listed below main steps to register Plugins inside CRM 4.0.

To register Plugins on CRM 4.0 Please follow these steps:

1) Your assembly should be strongly named.
2) The Class that wills response to actions on activity should be implements IPlugin Interface.
3) Move your assemblies to C:\Program Files\Microsoft Dynamics CRM\Server\bin\assembly\ folder with any resources needed[like XML configuration file, and so on.].
4) Open Plugin Registration tool that is shipped with CRM Sdk 4.0
5) Connect to CRM server, then to CRM instance [NB: Your User Should be in Deployment Manager group.]


6) Register your assembly... to open Register assembly dialog Press (Ctrl +A)


7) Add step to your assembly to open Register new step Press(Ctrl + T).. Step is representing a response to an Action happened on CRM Entity..
For example: to response to an Update Event for Contact Entity.. You have to add a step like the following Picture:


2008-04-29

Test Run deployment issue: The location of the file or directory is not trusted... Error Message

Today I faced small problem while I am building Unit testing project to test my class library. in my class library I was using a DLL file located on a shared folder on my company's network.. when I tried to run the test project I got this error message:
Test Run deployment issue: The location of the file or directory is not trusted

the solution of this issue was about adding the network path to my trusted sites.. to do so I followed the following steps:
1) open "Microsoft .NET Framework 2.0 Configuration" from administrative Tools
2) Go to "Runtime security Policy" --> Machine --> Code Groups --> All Code
3) right click --> New .. then give a name and description for the new group --> click Next
4) in the new form choose "URL" and then type your Network path. you can type it in 2 ways:

a) Y:\* --> for the whole folder
b) y:\AssemblyName.dll --> for single DLL

5) Choose Next... and then choose "Full trust"
6) click Next and then finished
7) finally close you VS and reopen it again
8) have fun in using unit testing :)


Thanks Microsoft for such a nice integration between tools:)