Error: Microsoft.Crm.Setup.Server.PublishDefaultDataAction

When you have uninstalled CRM and try to install this again, you might run into the following error message:

Microsoft.Crm.Setup.Server.PublishDefaultDataAction failed --->System.MissingMethodException: Method not found: 'Void Microsoft.Crm.CrmCache`1.RemoveEntry(System.String)'.

This is being caused by the fact that you have other components of CRM still installed from the previous installation. Make sure you remove all components including the SSRS connector, the Outlook client and the E-mail router. That should help you fix the problem.

Kudos go out to my colleague Alex Ries who found this solution.

For reference purposes the exact log message (can be found in %\AppData\Microsoft\MSCRM\Logs).

05:45:38|Verbose| Web Wizard import: Success
05:45:38|Verbose| Business Task import: Success
05:45:38| Info| Executing Install action: Microsoft.Crm.Setup.Server.PublishDefaultDataAction
05:45:50| Error| System.Exception: Action Microsoft.Crm.Setup.Server.PublishDefaultDataAction failed. ---> System.MissingMethodException: Method not found: 'Void Microsoft.Crm.CrmCache`1.RemoveEntry(System.String)'.
at Microsoft.Crm.Caching.CrmMultiOrgCache`2.RemoveEntry(Guid organizationId, TKey key, Boolean fireNotification)
at Microsoft.Crm.Caching.CrmMultiOrgCache`2.RemoveEntry(Guid organizationId, TKey key)
at Microsoft.Crm.Metadata.LabelCache.Flush(Int32 languageCode, IOrganizationContext context, CacheType cacheType)
at Microsoft.Crm.Setup.Server.Utility.NewOrgUtility.OrganizationPublishDefaultData(Guid organizationId)
at Microsoft.Crm.Setup.Server.PublishDefaultDataAction.Do(IDictionary parameters)
at Microsoft.Crm.Setup.Common.Action.ExecuteAction(Action action, IDictionary parameters, Boolean undo)
--- End of inner exception stack trace ---, Error, RetryCancel, Option1

The path is not of a legal form

While installing the Dynamics CRM Data Migration Manager on a Dynamics CRM server, you might get this error message:

The path is not of a legal form

To solve this error you should go to the registry and change the InstallLocation of the CRM server. The location is different for x86 and x64, but can easily be found by going to:


In this key you should search for the key which contains "Microsoft Dynamics CRM Server". This should bring you to a location like:


In this key you should set the value for "InstallLocation" to "C:\Program Files\Microsoft Dynamics CRM ". The installation of the Dynamics CRM Data Migration Manager will then continue.

Credits for this solution go out to the CRM community where I found this solution.

Unexpected 401 when using NetworkService in Web Service call

When you are calling any CRM Web Service and you decide to specify your own credentials by using a new instance of NetworkCredential, then you should make sure that you are not specifying the 'UseDefaultCredentials' after you have specified the Credentials. This will cause IIS to not fully understand how to authenticate. The result is that you will get this 401.2 error message: Unauthorized: Access is denied due to server configuration. Internet Information Services (IIS).

So this code causes the error message:

CrmService service = new CrmService();
service.Credentials = new System.Net.NetworkCredential("user", "pwd", "domain");
service.UseDefaultCredentials = false;
service.CrmAuthenticationTokenValue = token;

And this is how it should be:

CrmService service = new CrmService();
service.Credentials = new System.Net.NetworkCredential("user", "pwd", "domain");
service.CrmAuthenticationTokenValue = token;

Loveparade drama

For those of you who do know me a bit, you'll know that I'm a fan of the Love Parade. Every year I'm there. This year was no different in that regards, a friend, my girlfriend and myself have attend this event this years Love Parade as well. As you might have heard, there has been a dramatic incident at the party this year which caused 19 people to die and hunderds of people to get insured. I'm glad to mention that we are fine, but we are terribly sad for the people who are not.

I have no words for what has happened.


MVP reawarded

I’d like to share with you that Microsoft has awarded me for the fifth time in a row the MVP award. This award is given by Microsoft to the people who are considered to be community leaders in a specific technology. This year some of my community activities include

- Giving presentations on the Convergence in Frankfurt en Rotterdam to +/- 200 Dynamics CRM customers
- Sharing insight about how to position Dynamics CRM and SharePoint for 50 Microsoft partners
- Keeping up to date a blog with about 12.000 page views each month[1]
- Supporting a student with her final thesis around “CRM in a museum”
- Membership of the Microsoft driven Dynamics CRM Content Advisory Board

I'd also like to use this opportunity to share my greatest respect for two of the MVP's who are leaving the group. I've always looked at these guys as thought leaders. These guys have helped me out so many times and I'm sure they will stay my mentors. Thanks Matt Parks! Thanks Guy Riddle! I'm sure we'll meet again.

Performance test with 100.000 concurrent users

Did you know that Microsoft and Dell performed a performance test on Dynamics CRM which included 100.000 concurrent users? They created a whitepaper about this test. If you're worried about the capabilities of the Dynamics CRM / xRM platform, then this is a must read: Download

Here's the summary of the white paper:

Microsoft® Dynamics CRM 4.0 is designed to help enterprise organizations attain a 360-degree view of customers, achieve reliable user adoption, adapt quickly to business change, and accelerate project delivery and returns—all on a platform that provides enterprise levels of scalability and performance. This white paper focuses on system configuration for the support of high-scale systems in virtual environments.

Microsoft, working with Intel® Corporation and Dell Inc., completed workload test of virtualized Microsoft Dynamics CRM 4.0 on Dell™ PowerEdge™ R910 servers equipped with Intel® Xeon® Processor 7500 Series and solid state drives (SSDs).With 20 virtual machines (VMs) on two Dell PowerEdge R910 servers, Microsoft Dynamics CRM 4.0 was able to sustain 100,000 users showing its ability to scale on a hardware platform ideal for large-scale application consolidation projects.

Results Summary
Benchmark testing was performed on a Microsoft Dynamics CRM 4.0 implementation that included Microsoft® Windows Server® 2008 R2 Hyper-V and Microsoft SQL Server® 2008 R2, two Dell PowerEdge R910 servers running Intel® Xeon® Processors 7500 Series-based with storage managed by a Dell PowerVault™ MD1220 with solid state drives.

Large enterprises often deploy multiple parallel CRM instances to meet the diverse needs of different business units or geographies. Microsoft Dynamics CRM meets this need through a multi-tenant architecture which can add independent tenants to a shared hardware and management environment. Microsoft Dynamics CRM’s multi-tenant capabilities were employed to create five organizations running under a single deployment with workload distributed across 20 virtual machines. In this test environment, Microsoft Dynamics CRM 4.0 demonstrated the following performance characteristics:

Concurrent Users: 100,000
Average Response Time: .29 seconds
Web Requests: 5.1 M/hr.
Business Transactions: 778,000/hr.

According to the Microsoft Dynamics CRM Scalability Benchmark May 2009 study, performance results with half as many concurrent users were as follows:

Concurrent Users: 50,000
Average Response Time: .12 seconds
Web Requests: 2.4 M/hr.
Business Transactions: 374,000/hr.

This workload demonstrates that five Microsoft Dynamics CRM 4.0 instances can achieve sub-second response times with 100,000 concurrent users executing a heavy workload in a virtual environment.

This white paper details the results of workload testing conducted on Microsoft Dynamics CRM 4.0 running on a Dell PowerEdge R910 server with Intel® X7560 (Nehalem-EX) processors and solid state drives. Included are:

• A description of the CRM implementation and the methods used to obtain the benchmark.

• Details of the hardware configuration and optimization settings used in testing.

• A summary of the key test parameters and results achieved.

These results reflect the scalability and performance of a specific Microsoft Dynamics CRM 4.0 implementation running in a particular test environment powered by Intel® Xeon® Processors 7500 Series-based servers. Each organization is different; factors ranging from industry vertical to geographic span can affect how an enterprise organization uses its CRM system, so results will vary for each implementation. Customers may be able to achieve higher levels of performance and scalability through customization and a finer level of optimization.

Special Epicenter price for my blog readers

The organization of Epicenter have very kindly allocated 10 'concession tickets' for me to offer to people.

One Day €129.00 Now €50.00 Save €80.00

Two Days* €189.00 Now €100.00 Save €90.00

Three Days* €229.00 Now €150.00 Save €80.00

Four Days* €239.00 Now €200.00 Save €39.00

Be the first to book. More details:

Speaking at the Epicenter 2010

If you don't have plans for this week yet, then you should consider coming over to Dublin for the Epicenter 2010. Matt Wittemann and myself will be doing presentations at this event around Dynamics CRM and xRM on Wednesday the 9th of June.

Next to these sessions I'd like to share some of the other highlights of the event:
Tuesday - Chris Horn on the Future of Irish Software with the Governments Innovation Strategy.
Wednesday - AOL Architect Ken Wilson on Web Service Design plus lot's of MVP .NET & Java stuff.
Thursday - Matt Raible's Web Framework smackdown plus HTML 5, Semantic, jQuery UI etc.
Friday - The results of a global cloud survey are revealed, plus cloud and mobile sessions including Windows Phone 7

Have a look at the website and/or the promotional video

Feel free to bring your most difficult questions!

0x81020030: Invalid file name

I'm using the approach as described here to create a folder in SharePoint. For some reason I do get the following error message every now and then.

0x81020030:Invalid file name.
The file name you specified could not be used. It may be the name of an existing file or directory, or you may not have permission to access the file.

Apparently this does not have to do anything with an existing file or directory, or permissions to access the file. What in my case does cause this error, is the fact that the sharepoint listname has a length of larger than 50 characters.

Since this was not mentioned on the web according to my biggest friends Google and Bing, I thought it might help somebody else as well.

CRMAsyncService using 100% CPU v2

A while ago I wrote an article around how to handle the situation that the CRMAsyncService is consuming 99 to 100% of the CPU of the CRM Server. That solution has been written around the scenario that there are basically no workflows running. Obviously, there is the possibility as well that the amount of workflows is causing such behavior.

CRM is tested to be capable of handling thousands of active workflows. This of course does require a minimum set of hardware. If you are having a heavy load on the CRMASyncService due to the amount of workflows in combination with a relatively small server, then you'll need to change default settings of CRM to make sure that your system will remain active.

The default settings for workflow are set to a minimum of 1000 active workflows and maximum 2000 active workflows. This is fine for a system of at least 8GB ram, preferably even more. If you are running a server with for instance 4GB ram, then you should consider lowering these settings. Experience has learned that a setting of 100 for the minimum and 200 for the maximum setting is a good setting for a 4GB server. The server then isn't busy all the time with looking at too many workflows which causes timeouts, but instead only looks at a few and is able to finish these workflows in time.

Here's a small SQL script which you can run on your server to change this setting.

UPDATE DeploymentProperties SET IntColumn=100 where ColumnName = 'AsyncItemsInMemoryLow'
UPDATE DeploymentProperties SET IntColumn=200 where ColumnName = 'AsyncItemsInMemoryHigh'

ExactTarget Error: No results were received from the ExactTarget API

If you are working on extensive integration with ExactTarget from Dynamics CRM, then you might come accross this error message:

"Error during send processing." "ExactTarget.MSCRM4.BusinessLogic.Connector.ExactTargetSendException: No results were received from the ExactTarget API. Send status is unknown. ---> ExactTarget.MSCRM4.BusinessLogic.Connector.ExactTargetSendException: No results were received from the ExactTarget API. Send status is unknown.
at ExactTarget.MSCRM4.ConnectorService.v2.Sends.Crm4SendRequest.SendToExactTarget(Send send, Int32 recipientCount)
--- End of inner exception stack trace ---
at ExactTarget.MSCRM4.ConnectorService.v2.Sends.Crm4SendRequest.SendToExactTarget(Send send, Int32 recipientCount)
at ExactTarget.MSCRM4.ConnectorService.v2.Sends.Crm4SendRequest.Execute()

This error occures if you are creating an et_exacttargetjob (Exact Target Send) record by using a system user who is not an ExactTarget user. Make sure you are setting the owner attribute of the Exact Target Send record to the correct user.

It's just a short tip, but since by the time of posting this can't be found by any popular search engine, I'm sure that this will help you, or myself in the future.

Plug-in code for SharePoint List creation

Like most of you know, Microsoft has created a demo VPC which you can download from partnersource. On this demo there are some interesting features. For instance, if you do create an account, then automatically a sharepoint folder is created and linked to the account. This has been done by using a plugin. The plug-in code has been added below. Of course you will need to change some things related to URLs and credentials, but this should get you started very quickly.

public void Execute(IPluginExecutionContext context)
DynamicEntity entity = (DynamicEntity) context.InputParameters.Properties["Target"];
string listName = entity["name"].ToString();
string g = context.OutputParameters.Properties["id"].ToString();
int templateID = 0x65;
Lists lists = new Lists();
lists.Url = "http://sharepoint/crmdocs/_vti_bin/Lists.asmx";
lists.Credentials = new NetworkCredential("administrator", "pass@word1", "contoso");
string str3 = lists.AddList(listName, listName + " Document Library", templateID).InnerXml.ToString();
DynamicEntity entity2 = new DynamicEntity();
entity2.Name = EntityName.account.ToString();
entity2["accountid"] = new Key(new Guid(g));
entity2["new_sharepointdocumentlibraryurl"] = "http://sharepoint/crmdocs/" + listName + "/Forms/AllItems.aspx";

Create Folder in SharePoint using Web Services

Thanks to some other bloggers on the web, especially David Klein, I've been able to quickly build code which allows me to create and/or ensure that a folder in a particular document library does exist. It took a while to get everything working exactly as it should, but in this post I do paste the code as it works.

First you would need to create a web reference to the following webservice:
Or another location if you do have a specific server or location.

Then copy and paste the code below and this should work. The listName should be the name of the document library and the destinationFolder can be any desired folder in SharePoint.

static string FOLDER_EXISTS = "0x8107090d";
static string SUCCESS = "0x00000000";

private void CreateFolder(string listName, string destinationFolder)
string[] folders = destinationFolder.Split('/');
if (folders.Length > 0)
string path = folders[0];
for (int i = 1; i < folders.Length; i++)
CreateFolder(listName, path, folders[i]);
path = path + "/" + folders[i];

/// <summary>
/// As checked in U2U CAML query builder, this is valid in
/// <Batch PreCalc='TRUE' OnError='Continue' RootFolder='/Purchase Order Forms V2'>
///<Method ID='1' Cmd='New'><Field Name='ID'>New</Field><Field Name='FSObjType'>1</Field><Field Name='BaseName'>DDkTest2</Field></Method></Batch>
/// THIS Works for Subfolders
/// <Batch PreCalc='TRUE' OnError='Continue' RootFolder='/Purchase Order Forms V2/2010_01_January'>
/// <Method ID='1' Cmd='New'><Field Name='ID'>New</Field><Field Name='FSObjType'>1</Field><Field Name='BaseName'>DDkTest2</Field></Method></Batch>
/// </summary>
private void CreateFolder(string listName, string rootSubFolderName, string newFolderName)
SharePointListService.Lists listService = new SharePoint_Tests.SharePointListService.Lists();
listService.Credentials = System.Net.CredentialCache.DefaultCredentials;

//Correct invalid characters
newFolderName = newFolderName.Replace(":", "_");
string rootFolder = rootSubFolderName.Length > 0 ? string.Format("/{0}/{1}", listName, rootSubFolderName) : listName;
string xmlCommand = string.Format("<Method ID='1' Cmd='New'><Field Name='ID'>New</Field><Field Name='FSObjType'>1</Field><Field Name='BaseName'>{1}</Field></Method>", rootFolder, newFolderName);
XmlDocument doc = new XmlDocument();
System.Xml.XmlElement batchNode = doc.CreateElement("Batch");
batchNode.SetAttribute("OnError", "Continue");
//Insert / to front as it is required by web service.
if (!rootFolder.StartsWith("/"))
rootFolder = string.Format("/{0}",rootFolder);

batchNode.SetAttribute("RootFolder", rootFolder);
batchNode.InnerXml = xmlCommand;
XmlNode resultNode = listService.UpdateListItems(listName, batchNode);
if ((resultNode != null) && (resultNode.FirstChild.FirstChild.InnerText == FOLDER_EXISTS) || (resultNode.FirstChild.FirstChild.InnerText == SUCCESS))
// success
throw new Exception("Create new folder failed for: " + newFolderName + ". Error Details: " + resultNode.OuterXml);

SharePoint error message 0x8107026f

Interesting. For the first time in quite a while I'm programming agains SharePoint again. I am working on a possibility to upload files to a specific location in WSS, so the steps I need to make sure are:
- Check if the destination folder exist
- Create the destination folder if necessary
- Upload the file

In the process of creating the destination folder I do encounter a couple of error messages. The most interesting one is message 0x8107026f. Apparently nobody else on the internet has ever posted a question about this code before. My biggest online friends, Bing and Google, were not able to help me out here. But, I have been able to locate the issue and would like to share the cause and solution here.

The location where I do get this error message is in the last line of code:

batchNode.SetAttribute("RootFolder", rootFolder);
batchNode.InnerXml = xmlCommand;
XmlNode resultNode = listService.UpdateListItems(listName, batchNode);

the rootFolder in this case has been concatenated from the current location and the new desired destination folder. Apparently the UpdateListItems call can only create the last folder of the rootFolder. If you need to create more folders like a tree, then you would need to call this function multiple times. For example. If your root node is "My Files/Campaigns/Campaign x/Mail Merge Files" and the document library My Files does exist and in the Doc Lib there is a folder for Campaigns, but there is no folder for "Campaign x" yet, then this will need to be created first before the UpdateListItems could be called for "Mail Merge Files"

Some related error messages:

0x8107026f: The destination file or folder does not exist
0x81020073: The file or folder name contains characters that are not permitted
0x8107090d: The file or folder name does already exist
0x00000000: Succes
0x81020020: Invalid URL value A URL field contains invalid data. Please check the value and try again

The error code 0x81020020 can be caused because you are using a sitename in the webservice URL, but you have omitted to use the same name in the root folder.

Retrieving emails from ExactTarget based on a folder

There are some interesting documentation issues with regards to ExactTarget. For instance, if you are programming against ExactTarget to retrieve all emails which belong to a specific folder, then you would expect that you can filter on the 'folder' attribute of an email. Apparently that doesn't work, but you will have to use the CategoryID attribute. But then again, filtering against the CategoryID doesn't filter the result on the folder.

According to ExactTarget:
There is a known issue with the MSCRM integrated accounts when using a Simple Filter Part on CategoryId via the API. You can use sfp.Property=”fkCategoryid’ and that should work. So you can above method or as a workaround, you can do the filtering in the client application (so your application once you retrieve all the data).

So far the theoretical information. Now the useful summary:

public ArrayList GetEmails(int folderId)
// Intialize variables
String requestID;
APIObject[] results;

// Create Filter
SimpleFilterPart sfp = new SimpleFilterPart();
sfp.Property = "fkCategoryID";
sfp.SimpleOperator = SimpleOperators.equals;
sfp.Value = new string[] { folderId.ToString() };

// Create RetrieveRequest
RetrieveRequest rr = new RetrieveRequest();
rr.QueryAllAccounts = true;
rr.QueryAllAccountsSpecified = true;
rr.ObjectType = "Email";
rr.Properties = new string[] { "Name", "ID", "CategoryID" };
rr.Filter = sfp;

// Execute RetrieveRequest
String status = _exactTarget.Retrieve(rr, out requestID, out results);

ArrayList alEmail = new ArrayList();
for (int i = 0; i < results.Length; i++)
Email email = (Email)results[i];
return alEmail;

Error: End element 'Fault' from namespace '' expected

When connecting to a WSE 3.0 service, like ExactTarget, you might encounter this exception:

"End element 'Fault' from namespace '' expected. Found element 'detail' from namespace ''

This does basically mean that the soap version of the client doesn't match the server. You might be able to change this in the web.config. For ExactTarget they require you to add a custom binding to the webconfig which specifies the soap version. This is the piece which ExactTarget asks developers to add to their web.config:

<binding name="SoapBinding">
<security authenticationMode="UserNameOverTransport"></security>
<textMessageEncoding messageVersion="Soap12WSAddressingAugust2004"/>

In this binding you can easily change the messageVersion to "Soap11WSAddressingAugust2004". This will cause the message to be read correctly.

Retrieve Marketinglists attached to Campaign Activity

Today I've been doing some coding again and I've found an interesting situation. For my code I do need to find which marketing lists belong to a specific Campaign Activity. Apparently more people on the internet faced the same issue, but I haven't found anybody who supplied the answer on how to do that.

I've managed to find an approach which works for both the fetchXml as well as a QueryExpression. Here is the code for both of these options:


StringBuilder sbFetchXml = new StringBuilder();
sbFetchXml.Append("<fetch version=\"1.0\" output-format=\"xml-platform\" mapping=\"logical\" distinct=\"true\">");
sbFetchXml.Append("<entity name=\"list\">");
sbFetchXml.Append("<attribute name=\"listname\"/><attribute name=\"listid\"/>");
sbFetchXml.Append("<order attribute=\"listname\" descending=\"true\"/>");
sbFetchXml.Append("<link-entity name=\"campaignactivityitem\" from=\"itemid\" to=\"listid\" visible=\"false\" intersect=\"true\">");
sbFetchXml.Append("<link-entity name=\"campaignactivity\" from=\"activityid\" to=\"campaignactivityid\" alias=\"aa\">");
sbFetchXml.Append("<filter type=\"and\">");
sbFetchXml.AppendFormat("<condition attribute=\"activityid\" operator=\"eq\" uitype=\"campaignactivity\" value=\"{0}\"/>", campaignActivityId);

string strXmlResult = service.Fetch(sbFetchXml.ToString());


ConditionExpression condActivityId = new ConditionExpression();
condActivityId.AttributeName = "activityid";
condActivityId.Operator = ConditionOperator.Equal;
condActivityId.Values = new object[] { campaignActivityId };

FilterExpression filter = new FilterExpression();
filter.FilterOperator = LogicalOperator.And;
filter.Conditions = new ConditionExpression[] { condActivityId };

LinkEntity leCampaignActivity= new LinkEntity();
leCampaignActivity.LinkFromEntityName = EntityName.campaignactivityitem.ToString();
leCampaignActivity.LinkFromAttributeName = "campaignactivityid";
leCampaignActivity.LinkToEntityName = EntityName.campaignactivity.ToString();
leCampaignActivity.LinkToAttributeName = "activityid";
leCampaignActivity.LinkCriteria = filter;

LinkEntity leCampaignActivityItem = new LinkEntity();
leCampaignActivityItem.LinkFromEntityName = EntityName.list.ToString();
leCampaignActivityItem.LinkFromAttributeName = "listid";
leCampaignActivityItem.LinkToEntityName = EntityName.campaignactivityitem.ToString();
leCampaignActivityItem.LinkToAttributeName = "itemid";
leCampaignActivityItem.LinkEntities = new LinkEntity[] {leCampaignActivity};

QueryExpression query = new QueryExpression();
query.EntityName = EntityName.list.ToString();
query.ColumnSet = new AllColumns();
query.LinkEntities = new LinkEntity[] { leCampaignActivityItem };

BusinessEntityCollection bec = service.RetrieveMultiple(query);

For me this worked, I hope this helps you as well!

Minimal requirements for configuring Outlook Client (Online version)

Some customers don't allow end users to install software on their own desktop. This can even go up to completely locked down systems on which the end users doesn't have any rights. Installing the CRM outlook client on such a machine is a quite a hard task to do. Usually this can be scripted and by doing so it will be installed by a user with enough rights. After installing the Outlook client, it still needs to be configured. By playing trial and error I found that the user does require at least read and write rights required for configuring the CRM Outlook client:

- HKCU\Software\Microsoft\
- c:\Users\username\AppData\Roaming\Microsoft\
- c:\Windows\system32\MAPISVC.INF
- C:\Program Files\Common Files\System\MSMAPI\1033\MAPISVC.INF - "Program Files (x86)" for 64bit machines

These have been the items that we needed to unlock in my project. If you find any other resources to which you need to provide access to, please let me know and I'll add that to this list.

CRM 5 and Windows Azure

Girish Raja has created a nice video in which he shows a real life example of how Windows Azure can be used in combination with Dynamics CRM. Not only is he using Dynamics CRM, he is using CRM 5. Make sure you watch this video to learn some neat things about:
- Dynamics CRM 5.0 (including nested grids, visualizations and dashboards)
- Windows Azure (including AppFabric Service Bus)

Girish Raja's blog