lab
lab copied to clipboard
"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'."
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.
I am experiencing exactly the same problem. Has anyone found a solution for this?
Any news? -- This is kind of a blocking bug that is preventing folks from using the tool.
Any updates on this? it is affecting us to generate proxy for consuming D365 for operation Odata endpoints.
I also have same problem.
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.
Hi All,
Even I`m getting the same error message. Please provide a solution for this.
Regards,
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
- In your project that needs reference to the MSGraph entities, right-click on the project in Solution Explorer and go to Add->New Item.
- There should be an option for OData Client. Name your .tt file as appropriate.

- 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:
Also attached my generated file. ProxyForMSGraphBeta.zip
Now it works great in Unchase OData ConnectedService v.1.1.2. Check it.