Skip to main content

oData client

editSubscribe (0) ShareShare
Posted on by 335


has anyone successfully used an oData client recently ?

in the past I have successfully used the v4 oData client code generator to create the client :

It appears that nowadays in 10.0.5 PU29, the entity metadata has grown so much that Visual Studio can't even 

create the client file anymore. I had to remove ten thousands of lines in the GenerateEdmModel class just to be

able to compile ODataClient.cs. As a result, it does not work properly, probably because of the missing metadata.

Following the pattern below, I'm running into errors such as {"Length cannot be less than zero.\r\nParameter name: length"}

for instance for code that used to run successfully (

private abstract class GeneratedEdmModel
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "7.5.1")]
private static global::Microsoft.OData.Edm.IEdmModel ParsedModel = LoadModelFromString();
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "7.5.1")]
private const string Edmx = @"<edmx:Edmx Version=""4.0"" xmlns:edmx=""">">"">


<Schema Namespace=""Microsoft.Dynamics.DataEntities"" xmlns=""">">"">
<EntityType Name=""ElectronicPaymentType"">
<PropertyRef Name=""PaymentType"" />
<PropertyRef Name=""dataAreaId"" />

Question is, am I doing something wrong or someone else experiencing the same ? And is there a work around or

alternative ?