Inside Microsoft Dynamics CRM 3.0

Arne Janning

  Home  |   Contact  |   Syndication    |   Login
  3 Posts | 0 Stories | 13 Comments | 51 Trackbacks

News

Archives

MSCRM blogs I read

So let's simply start this blog.

One of my goals is to show how one can inject custom code in CRM 3.0 - I'm not talking about callouts or supported and documented stuff (of course I will write about this as well on this blog) - I'm talking about changing the internal objects and data structures at runtime.

To that end we will have to look a lot at the code Reflector gives us, to see what's really going on under the hood. To that same end - and for many other things - using the built-in tracing-mechanism is really useful to see what MSCRM actually does.

Although there is a section "Registry Settings" in the SDK it is not documented how to enable tracing.

But Reflector shows that there is a class called CrmTrace in Microsoft.Crm.dll. The method Microsoft.Crm.CrmTrace.LoadTrace() : Boolean shows the registry keys that are necessary to enable tracing:

private static bool LoadTrace()
{
      string[] textArray2;
     //[...]
     textArray2 = new string[] { "TraceEnabled", "TraceSchedule", "TraceCallStack", "TraceCategories" } ;
     //[...]
     text1 = "TraceEnabled";
     CrmTrace.isTracingOff = ((int) RegistryCache.GetValue("TraceEnabled")) == 0;
     //[...]

 

So to enable the tracing-mechanism you simply have to add some registry keys to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM:

  • TraceEnabled (dword) - set the value to 1 to turn on tracing, set the value to 0 to turn it off again
  • TraceDirectory (string) - this is the directory where the trace files are stored. The directory has to exist, CRM will not create the directory.
  • TraceCategories (string) - set the value to *:Verbose
  • TraceCallStack (dword) - set the value to 1 if your're interested in the stack trace
  • TraceRefresh (dword) - set the value to 1
  • TraceSchedule (string) - set it to one of the values of the Microsoft.Crm.TraceSchedule-enum: e.g. Daily or Hourly

It is not necessary to restart IIS, MSCRM 3.0 has a mechanism of getting notified of configuration-changes at runtime. This mechanism gets started by the Microsoft.Crm.MainApplication.Application_OnStart()-method in Microsoft.Crm.Application.Pages.dll:

NotificationManager.StartNotificationsThread(new Notification());

Microsoft.Crm.MainApplication.Application_OnStart() is the main entrypoint for the whole MSCRM-application. We will speak about this later in much greater detail.

To be continued...

posted on Wednesday, November 16, 2005 5:24 PM

Feedback

# re: Enable tracing in Microsoft Dynamics CRM 3.0 1/25/2006 12:50 AM peter
Really eager to see the articles on how to inject custom code to MS CRM 3.0. I need to do the same thing but don't have any clue until now. I plan to use some methods (Reflection.Emit, DynamicProxy) used by AOP, but seems not very suit...


Peter
email: peteryin007@gmail.com

# re: Enable tracing in Microsoft Dynamics CRM 3.0 1/25/2006 12:56 AM peter
Really eager to see the articles on how to inject custom code to MS CRM 3.0. I need to do the same thing but don't have any clue until now. I plan to use some methods (Reflection.Emit, DynamicProxy) used by AOP, but seems not very suit...


Peter
email: peteryin007@gmail.com

# re: Enable tracing in Microsoft Dynamics CRM 3.0 1/17/2008 3:28 AM soumya
Hi,

I am in neeed of extending the MS CRM 3.0 customizations beyond what is provided in SDK

if you could help me with more sample codes for directly customizing the platform it would be of great help to me

Thanks,
Soumya

# re: Enable tracing in Microsoft Dynamics CRM 3.0 6/5/2008 11:59 PM CRM Developer
nice article, you saved my time. thanks.

Post Feedback

Title:
Name:
Email: (never displayed)
Url:
Comments: 
Please add 2 and 7 and type the answer here: