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

Odpovědi

  • 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



    1. března 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.

    2. března 2012 5:46
    Moderátor

Všechny reakce

  • 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.

    1. března 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



    1. března 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

    2. března 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.

    2. března 2012 5:46
    Moderátor
  • 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

    2. března 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.

    2. března 2012 7:15
    Moderátor
  • hi vidhyut,

    did my answer worked for you...?


    Anwar noori

    • Navržen jako odpověď anwar.noori 5. března 2012 12:42
    5. března 2012 12:41