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
This issue was resolved with the nuget release NuGet Gallery | Microsoft.CrmSdk.CoreTools 9.1.0.68 this was release the 2ed week of January.
Daryl's XRM toolbox addin was also updated
thanks
MattB.
Yes we are still facing same issue. But alternative solution is that generate early bound class for only related entities (Entities used in the project). Do not generate for all.
With the latest XRM ToolBox version it should work.
Hello,
This started happening for me too just before christmas. Out of nowhere..
No solution yet?
I'm having the very same problem!
Is this a problem with early bound generator or something changed in CRM Online ?
We have used Early bound generator. Getting same exception. We are able to generate classes for specific entities but not for all entities.
try to use Early Bound Generator (it's a plugin available inside XrmToolBox)
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,522 Super User 2024 Season 2
Martin Dráb 228,441 Most Valuable Professional
nmaenpaa 101,148