Hi All,
We are trying to generate early bound class with CRMSvc.util, but we are getting System.NullReferenceException.
This is happening for entities only. For optionset and functions there is no issue like this.
CrmSvcUtil : CRM Service Utility [Version 9.1.0.25]
1> c 2019 Microsoft Corporation. All rights reserved
1>
1>
1> Exiting program with exception: Object reference not set to an instance of an object.
1>EXEC : CrmSvcUtil error : 2 : Exiting program with exit code 2 due to exception : System.NullReferenceException: Object reference not set to an instance of an object.
1> at Microsoft.Crm.Services.Utility.CodeGenerationService.UpdateAttributeMemberStatements(AttributeMetadata attribute, CodeTypeMember attributeMember)
1> at Microsoft.Crm.Services.Utility.CodeGenerationService.BuildAttributeOptionSet(EntityMetadata entity, AttributeMetadata attribute, CodeTypeMember attributeMember, ServiceProvider serviceProvider)
1> at Microsoft.Crm.Services.Utility.CodeGenerationService.BuildEntity(EntityMetadata entity, ServiceProvider serviceProvider)
1> at Microsoft.Crm.Services.Utility.CodeGenerationService.BuildEntities(EntityMetadata[] entityMetadata, ServiceProvider serviceProvider)
1> at Microsoft.Crm.Services.Utility.CodeGenerationService.BuildCodeDom(IOrganizationMetadata organizationMetadata, String outputNamespace, ServiceProvider serviceProvider)
1> at Microsoft.Crm.Services.Utility.CodeGenerationService.Microsoft.Crm.Services.Utility.ICodeGenerationService.Write(IOrganizationMetadata organizationMetadata, String language, String outputFile, String outputNamespace, IServiceProvider services)
1> at Microsoft.Crm.Services.Utility.CrmSvcUtil.WriteCode(IOrganizationMetadata organizationMetadata)
1> at Microsoft.Crm.Services.Utility.CrmSvcUtil.Run()
1> at Microsoft.Crm.Services.Utility.CrmSvcUtil.Main(String[] args)
1>EXEC : CrmSvcUtil error : 2 : ===== DETAIL ======
1>EXEC : CrmSvcUtil error : 2 : Source : CrmSvcUtil
1> Method : UpdateAttributeMemberStatements
1> Date : 2:48:13 PM
1> Time : 12/18/2020
1>EXEC : error : Object reference not set to an instance of an object.
1> Stack Trace : at Microsoft.Crm.Services.Utility.CodeGenerationService.UpdateAttributeMemberStatements(AttributeMetadata attribute, CodeTypeMember attributeMember)
1> at Microsoft.Crm.Services.Utility.CodeGenerationService.BuildAttributeOptionSet(EntityMetadata entity, AttributeMetadata attribute, CodeTypeMember attributeMember, ServiceProvider serviceProvider)
1> at Microsoft.Crm.Services.Utility.CodeGenerationService.BuildEntity(EntityMetadata entity, ServiceProvider serviceProvider)
1> at Microsoft.Crm.Services.Utility.CodeGenerationService.BuildEntities(EntityMetadata[] entityMetadata, ServiceProvider serviceProvider)
1> at Microsoft.Crm.Services.Utility.CodeGenerationService.BuildCodeDom(IOrganizationMetadata organizationMetadata, String outputNamespace, ServiceProvider serviceProvider)
1> at Microsoft.Crm.Services.Utility.CodeGenerationService.Microsoft.Crm.Services.Utility.ICodeGenerationService.Write(IOrganizationMetadata organizationMetadata, String language, String outputFile, String outputNamespace, IServiceProvider services)
1> at Microsoft.Crm.Services.Utility.CrmSvcUtil.WriteCode(IOrganizationMetadata organizationMetadata)
1> at Microsoft.Crm.Services.Utility.CrmSvcUtil.Run()
1> at Microsoft.Crm.Services.Utility.CrmSvcUtil.Main(String[] args)
1> ======================================================================================================================
Thanks in advance.
Sheharyar Hanif