With Bonus: LINQ to SQL!
I deal with many Microsoft Dynamics CRM servers that are in many different states of configuration and I often want a quick view of those configuration settings. This version of CRM, 4.0, appears to be in a bit of a philosophical transition with regards many things, including as to where to store their configuration settings - in the registry or in the CRM configuration database - a quandary that provides a huge challenge to their internal code when it comes to precedence for SDK calls vs client calls, etc. It's very helpful to look at these two places at once when determining if plug-in or client javascript sdk calls are failing.
I came up with the "CRM Environment Check" app that displays both and also saves the output to XML. Nothing special - it took me about 10 minutes last night to think of it, 10 minutes to fire up the VM and get halfway done, and 10 minutes this morning to polish it to what you see here.
Works as promised, with XML output.
I like to add a few techniques to my toolbox so I figured I'd put in LINQ to SQL for the access to the MSCRM deployment properties table. I did, it was pretty easy and I was aglow.
At least, that's what I thought.
Crowing about my success - sorry blog, I couldn't wait - I told Chris who immediately and cruelly started mocking me about the death of LINQ to SQL and my poor choices in life.
I read this on my favorite tech website, InfoQ, Is LINQ to SQL Truly Dead?, dated yesterday.
Glad I didn't do much more with LINQ to SQL other than a "select" statement.
This experience has been a quick lesson in Microsoft technologies - the newest stuff looks easy to use, has lots of promise, and delivers (when I get around to using it), but inevitably, has some, shall we say, "scaling" issues.
// Define a data object class
[Table(Name="DeploymentProperties")]
public class DeploymentProperty
{
[Column(Name="NVarCharColumn")] public string Value;
[Column(Name="ColumnName")] public string Property;
}
...
using System.Data.Linq;
...
DataContext db = new DataContext(configDbConnect);
Table DeploymentProperties = db.GetTable();
var query = from p in DeploymentProperties
where p.Value!= null
select new { p.Property, p.Value };
foreach (var row in query)
deploymentPropertiesValues.Add(row.Property, row.Value);
Update: Version 1.1.0.4
Now includes ADSI to display Microsoft Dynamics CRM IIS website info and the hosts file, needed for determining the workaround for the hardcoded 'localhost' in RTM's services. (There is a hotfix for the hardcoded 'localhost' particular issue.)