Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Adding OData Connected Service to the project failed: Unable to cast object of type 'Microsoft.OData.Edm.Library.AmbiguousTypeBinding' to type 'Microsoft.OData.Edm.IEdmCollectionType'." #75

Open
BrainSlugs83 opened this issue Nov 17, 2017 · 8 comments
Assignees
Labels

Comments

@BrainSlugs83
Copy link

Using the Add-in with VS2017 -- trying to add a connected OData service for the beta version of Microsoft Graph (https://graph.microsoft.com/beta/$metadata), and I end up with this:

Adding Nuget Packages
Generating Client Proxy ...
Error:Adding OData Connected Service to the project failed: Unable to cast object of type 'Microsoft.OData.Edm.Library.AmbiguousTypeBinding' to type 'Microsoft.OData.Edm.IEdmCollectionType'.

Trying to do it with T4 templates gives the same error.

@mattskel
Copy link

I am experiencing exactly the same problem. Has anyone found a solution for this?

@BrainSlugs83
Copy link
Author

Any news? -- This is kind of a blocking bug that is preventing folks from using the tool.

@rizworks
Copy link

Any updates on this? it is affecting us to generate proxy for consuming D365 for operation Odata endpoints.

@qazsen
Copy link

qazsen commented Jan 23, 2018

I also have same problem.

@dcs-kartik
Copy link

Is there any solution for this error.?

As one of the way to create a file and reference to that file doesn't work. there is reference among the entities so we cannot identify what to remove and what to keep.

@zameer218
Copy link

Hi All,

Even I`m getting the same error message. Please provide a solution for this.

Regards,

@AlanWong-MS AlanWong-MS added P1 and removed P4 labels Jul 2, 2018
@AlanWong-MS
Copy link
Contributor

AlanWong-MS commented Jul 2, 2018

There is a code delta between the Connected Services extension and the actively developed Client Code Gen extension; the state of the Connected Services extension is under review. A workaround for now is to use the Client Code Gen extension to help generate the proxy code against https://graph.microsoft.com/beta/$metadata.

One can accomplish this by installing the extension from above and then

  1. In your project that needs reference to the MSGraph entities, right-click on the project in Solution Explorer and go to Add->New Item.
  2. There should be an option for OData Client. Name your .tt file as appropriate.
    image
  3. A .tt file should be added to your project. Double-click on it in the Solution Explorer to open it. Add "https://graph.microsoft.com/beta/$metadata" into the MetadataDocumentUri field (it should read public const string MetadataDocumentUri = "https://graph.microsoft.com/beta/$metadata";). Then hit Ctrl+S to save the file and your proxy should be generated. Sample below:
    image

Also attached my generated file.
ProxyForMSGraphBeta.zip

@unchase
Copy link

unchase commented Apr 15, 2019

Now it works great in Unchase OData ConnectedService v.1.1.2. Check it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants