This project has moved. For the latest updates, please go here.

Not Emitting CodeAttributes on Entity Classes when Generating Attribute Name Consts

May 6, 2015 at 8:51 PM
Using the latest version (1.2015.4.10).

When the option "Generate Attribute Name Consts" is selected the resulting entity file does not contain any code attributes on the generated entity classes. This is problematic because EntityLogicalNameAttribute

This results in an error when using the Entity.ToEntity<>() method.

Here is the correct output (what you get if you don't select the Attribute Consts):
/// <summary>
    /// Business that represents a customer or potential customer. The company that is billed in business transactions.
    /// </summary>
    [System.Runtime.Serialization.DataContractAttribute()]
    [Microsoft.Xrm.Sdk.Client.EntityLogicalNameAttribute("account")]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("CrmSvcUtil", "7.0.0000.3543")]
    public partial class Account : Microsoft.Xrm.Sdk.Entity, System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged
    { //Removed for Brevity
}
But when you do select the Attribute Consts option you get this:
/// <summary>
    /// Business that represents a customer or potential customer. The company that is billed in business transactions.
    /// </summary>
    public partial class Account : Microsoft.Xrm.Sdk.Entity, System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged
    { //Removed for Brevity
}
Coordinator
May 7, 2015 at 2:56 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
May 7, 2015 at 2:58 PM
Thanks for reporting this. I believe I've fixed this with the 5.7 release. It also includes changes to use the newest version of the XTB which moved everything inot hte plugins directory, so you may need to move your DLab.EarlyboundGenerator configuration file into the plugin directory.

Can you let me know if this doesn't get resolved?
May 26, 2015 at 11:36 PM
Sorry for the late reply, yes this fixed it. Thanks so much for the fix and this great project!
Coordinator
May 29, 2015 at 11:28 PM
Glad to help. Thanks for your SO answers ;)