El MoZo
El MoZo

Reputation: 157

Using the Plugin Profiler

Hi every one and sorry for my poor English.

Im' trying to use the plugin profiler in Dynamics CRM 2011 but I can't really success to use it.

First, when i try to Profile an asynchronous plugin i'm not able to Download the error Log file (fine with synchronous, th message dialog pop and i can click on the link button to download it) Is that possible to use Plugin profiler on asynchronous plugin ?? If yes, how i download the error log file ? I know asynchronous plugin are not executed at the same place, that probably why i d'ont have the dialog message but i can see the task have been executed in the "Parameters" "systems task" in the CRM itself. The status of the task is waiting. I can see in the error details something like the error log but i'm not able to download it.

Second, with synchronous plugin it work fine. I'm able to download the error log file and put it in the plugin registration debug tool. But when I attach my process and run the start execution my plugin stop at this line wich work fine when the plugin execute itself normally :

IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
//This line i got null references exception
serviceFactory.GetType().GetProperty("ProxyTypesAssembly").SetValue(serviceFactory, typeof(Account).Assembly, null);

I got a null reference exception. This line needed to use early bound in plugin. (If i remove this line i got some error during the plugin execution : "Unable to cast object of type 'Microsoft.Xrm.Sdk.Entity' to type '....'."

After doing some test it's the property he can't get with the Plugin Profiler :

//Null      
var myProperty = serviceFactory.GetType().GetProperty("ProxyTypesAssembly");

I got null reference for the property with Plugin Profiler but during a normal execution of the plugin this work fine. Any ideas ??

Thx a lot !

Upvotes: 1

Views: 1255

Answers (1)

Alexei P
Alexei P

Reputation: 63

For async plugin you have to select another Profile storage. You need "Persist to Entity" option, not the "Exception". That is step 6 from this link

Hope that helps.

Upvotes: 1

Related Questions