Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

CRM Online Unable to Generate Early Bound Class using CRMSvcUtil - NullReferenceException

Posted on by 5

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

  • Suggested answer
    MattB-MSFT Profile Picture
    MattB-MSFT on at
    RE: CRM Online Unable to Generate Early Bound Class using CRMSvcUtil - NullReferenceException

    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. 

  • Sheharyar Hanif Profile Picture
    Sheharyar Hanif 5 on at
    RE: CRM Online Unable to Generate Early Bound Class using CRMSvcUtil - NullReferenceException

    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. 

  • KalleK Profile Picture
    KalleK 30 on at
    RE: CRM Online Unable to Generate Early Bound Class using CRMSvcUtil - NullReferenceException

    With the latest XRM ToolBox version it should work.

    github.com/.../265

  • Fedorov Profile Picture
    Fedorov 338 on at
    RE: CRM Online Unable to Generate Early Bound Class using CRMSvcUtil - NullReferenceException

    Hello, 

    This started happening for me too just before christmas. Out of nowhere..

    No solution yet?

  • KalleK Profile Picture
    KalleK 30 on at
    RE: CRM Online Unable to Generate Early Bound Class using CRMSvcUtil - NullReferenceException

    I'm having the very same problem!

    Is this a problem with early bound generator or something changed in CRM Online ?

  • Sheharyar Hanif Profile Picture
    Sheharyar Hanif 5 on at
    RE: CRM Online Unable to Generate Early Bound Class using CRMSvcUtil - NullReferenceException

    We have used Early bound generator. Getting same exception. We are able to generate classes for specific entities but not for all entities.

  • Suggested answer
    Guido Preite Profile Picture
    Guido Preite 54,081 Super User 2024 Season 1 on at
    RE: CRM Online Unable to Generate Early Bound Class using CRMSvcUtil - NullReferenceException

    try to use Early Bound Generator (it's a plugin available inside XrmToolBox)

    www.xrmtoolbox.com/.../

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans