web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Unable to cast object of type 'Microsoft.OData.Edm.AmbiguousTypeBinding' to type 'Microsoft.OData.Edm.IEdmCollectionType'.

(0) ShareShare
ReportReport
Posted on by 2,546

I am trying to extract metadata using Odata client but getting below error.

Severity Code Description Project File Line Suppression State
Error Running transformation: System.InvalidCastException: Unable to cast object of type 'Microsoft.OData.Edm.AmbiguousTypeBinding' to type 'Microsoft.OData.Edm.IEdmCollectionType'.
at Microsoft.VisualStudio.TextTemplating561CD1CDC97E85A1F1911DD0D0B6E00009683F3D972C7FDDE690528FF6E0B54AB23B34E26A16A7698D737C590EC2F0A9B29E37D9D1973EA6D08E9E0A728C5312.GeneratedTextTransformation.Utils.GetClrTypeName(IEdmTypeReference edmTypeReference, Boolean useDataServiceCollection, ODataClientTemplate clientTemplate, CodeGenerationContext context, Boolean addNullableTemplate, Boolean needGlobalPrefix, Boolean isOperationParameter, Boolean isEntitySingleType) in :line 2797
at Microsoft.VisualStudio.TextTemplating561CD1CDC97E85A1F1911DD0D0B6E00009683F3D972C7FDDE690528FF6E0B54AB23B34E26A16A7698D737C590EC2F0A9B29E37D9D1973EA6D08E9E0A728C5312.GeneratedTextTransformation.ODataClientTemplate.<>c__DisplayClass225_0.<WritePropertiesForStructuredType>b__0(IEdmProperty property) in :line 2232
at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Microsoft.VisualStudio.TextTemplating561CD1CDC97E85A1F1911DD0D0B6E00009683F3D972C7FDDE690528FF6E0B54AB23B34E26A16A7698D737C590EC2F0A9B29E37D9D1973EA6D08E9E0A728C5312.GeneratedTextTransformation.ODataClientTemplate.WritePropertiesForStructuredType(IEnumerable`1 properties) in :line 2227
at Microsoft.VisualStudio.TextTemplating561CD1CDC97E85A1F1911DD0D0B6E00009683F3D972C7FDDE690528FF6E0B54AB23B34E26A16A7698D737C590EC2F0A9B29E37D9D1973EA6D08E9E0A728C5312.GeneratedTextTransformation.ODataClientTemplate.WriteEntityType(IEdmEntityType entityType, Dictionary`2 boundOperationsMap) in :line 1766
at Microsoft.VisualStudio.TextTemplating561CD1CDC97E85A1F1911DD0D0B6E00009683F3D972C7FDDE690528FF6E0B54AB23B34E26A16A7698D737C590EC2F0A9B29E37D9D1973EA6D08E9E0A728C5312.GeneratedTextTransformation.ODataClientTemplate.WriteNamespace(String fullNamespace) in :line 1257
at Microsoft.VisualStudio.TextTemplating561CD1CDC97E85A1F1911DD0D0B6E00009683F3D972C7FDDE690528FF6E0B54AB23B34E26A16A7698D737C590EC2F0A9B29E37D9D1973EA6D08E9E0A728C5312.GeneratedTextTransformation.ODataClientTemplate.WriteNamespaces() in :line 1204
at Microsoft.VisualStudio.TextTemplating561CD1CDC97E85A1F1911DD0D0B6E00009683F3D972C7FDDE690528FF6E0B54AB23B34E26A16A7698D737C590EC2F0A9B29E37D9D1973EA6D08E9E0A728C5312.GeneratedTextTransformation.ODataClientTemplate.TransformText() in :line 1196
at Microsoft.VisualStudio.TextTemplating561CD1CDC97E85A1F1911DD0D0B6E00009683F3D972C7FDDE690528FF6E0B54AB23B34E26A16A7698D737C590EC2F0A9B29E37D9D1973EA6D08E9E0A728C5312.GeneratedTextTransformation.TransformText() in :line 93 2797

*This post is locked for comments

I have the same question (0)
  • Piyush Adhikari Profile Picture
    2,546 on at
  • Piyush Adhikari Profile Picture
    2,546 on at

    Can someone please share me the sample project?

  • Suggested answer
    Vincent Nguyen Profile Picture
    290 on at

    Hi Piyush,

    I had a similar error 4 months back when trying with application version 8.0.

    Posted a new article on my blog vincentnguyendynamics365ops.wordpress.com/2018/08/22/fixing-the-odataclient-in-visual-studio-for-dynamics-365-for-finance-and-operations-application-version-8-0

    Hope this helps.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Sukrut Parab Profile Picture

Sukrut Parab 2 Moderator

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans