none
How to view a plugin's trace statements for CRM 2011

Respuestas

  • hi,

    implement iTracing in your PlugIn

    add Trace statements where you required 

    AtLast,put a throw exception and you will get  all tracing statements in error log file.

    it worked for CRM 2011 Online


    Anwar noori



    • Editado anwar.noori jueves, 01 de marzo de 2012 13:50
    • Marcado como respuesta Vidhyut Kediya viernes, 02 de marzo de 2012 8:59
    jueves, 01 de marzo de 2012 13:49
  • Hi,

    try to change below code

     ITracingService tracingService = (ITracingService)localContext.ServiceProvider.GetService(typeof(ITracingService)); // Error

    to

     ITracingService tracingService = localContext.TracingService;


    Mahain : Check My Blog
    Follow me on Twitter
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    viernes, 02 de marzo de 2012 5:46
    Moderador

Todas las respuestas

  • Hi Vidhyut ,

    It creates a trace file on the Trace folder on the SERVER

    hth

    dkay

    If the problem is resolved, we would appreciate a post explaining the resolution and mark the post answered and close the thread.

    jueves, 01 de marzo de 2012 13:14
  • hi,

    implement iTracing in your PlugIn

    add Trace statements where you required 

    AtLast,put a throw exception and you will get  all tracing statements in error log file.

    it worked for CRM 2011 Online


    Anwar noori



    • Editado anwar.noori jueves, 01 de marzo de 2012 13:50
    • Marcado como respuesta Vidhyut Kediya viernes, 02 de marzo de 2012 8:59
    jueves, 01 de marzo de 2012 13:49
  • Hi Anwar,

    I create instance with this code. It gives error of "Object Reference Not Set to instance".

     protected void ExecutePostCustomSampleEntityUpdate(LocalPluginContext localContext)
            {
                if (localContext == null)
                {
                    throw new ArgumentNullException("localContext");
                }
                IPluginExecutionContext context = localContext.PluginExecutionContext;
                IOrganizationService service = localContext.OrganizationService;
                ITracingService tracingService = (ITracingService)localContext.ServiceProvider.GetService(typeof(ITracingService)); // Error

    Do I need to do some system settings to enable tracing?


    vidhyut

    viernes, 02 de marzo de 2012 5:25
  • Hi,

    try to change below code

     ITracingService tracingService = (ITracingService)localContext.ServiceProvider.GetService(typeof(ITracingService)); // Error

    to

     ITracingService tracingService = localContext.TracingService;


    Mahain : Check My Blog
    Follow me on Twitter
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    viernes, 02 de marzo de 2012 5:46
    Moderador
  • Hi,

    That worked. Thanks. Where can I view the statement "Exception Caught" with below code? It shows "This is the error" on webpage message.

     tracingService.Trace("Exception caught ");
    throw new InvalidPluginExecutionException("This is the error ");


    vidhyut

    viernes, 02 de marzo de 2012 6:37
  • Hi,

    you should get exception information in a dialogbox, don't use throw new invalid plugin executeion exception here, just use throw statement only

    Please refer Logging and Tracing


    Mahain : Check My Blog
    Follow me on Twitter
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    viernes, 02 de marzo de 2012 7:15
    Moderador
  • hi vidhyut,

    did my answer worked for you...?


    Anwar noori

    • Propuesto como respuesta anwar.noori lunes, 05 de marzo de 2012 12:42
    lunes, 05 de marzo de 2012 12:41