I am using Crm 4.0 sdk to connect to Microsoft Dynamics CRM 4.0. When using CrmSvcutil.exe to generate the entities it crashes with the following error
Unhandled Exception: System.InvalidOperationException: Sequence contains no matching element at System.Linq.Enumerable.Single[TSource](IEnumerable'1 source, Func'2 predicate)
at CrmSvcUtil.Generator.GenerateEntityCode(XElement entityElement, String outputNamespace, DirectoryInfo outputDirectory, Boolean useLogicalNames, StreamWriter outputWriter)
at CrmSvcUtil.Generator.Generate(IDictionary`2 arguments)
at CrmSvcUtil.Program.Main(String[] args)
In particular its "SubscriptionTrackingDeletedObject" entity which is causing error.
I am using the following command line
crmsvcutil.exe /server:"http://MyServer/Org" /Out:"Xrm.cs" /namespace:"Xrm"/dataContextPrefix:"Xrm" /useDisplayNames
When I try to generate the code for just one entity (other than one causing error) the tool runs to completion successfully.
I am bit stumped. Any help will be greatly appreciated.