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

System.InvalidOperationException #34

Closed
Priyavaratharajan opened this issue Sep 14, 2017 · 4 comments
Closed

System.InvalidOperationException #34

Priyavaratharajan opened this issue Sep 14, 2017 · 4 comments

Comments

@Priyavaratharajan
Copy link

Hi,
I am getting error in this of code:
private static void ReadLegalEntities(Resources context)
{
Console.WriteLine();
foreach (var legalEntity in context.LegalEntities.AsEnumerable())
{ Console.WriteLine("Name:{0}", legalEntity.Name); }

Error File is about:
An unhandled exception of type ' System.InvalidOperationException' occurred in Microsoft.OData.Client.dll
Additional information: The key property 'Type' on for type
'ProductsApp4.Microsoft.Dynamics.DataEntities.LegalEntityContact' is of
type 'System.Nullable`1[[ProductsApp4.Microsoft.Dynamics.DataEntities.LogisticsElectronicAddressMethodType, ProductsApp4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]', which is not a simple type. Only properties of simple type can be key properties.

@vincentnavanade
Copy link

What can you see in ODataClient.cs? Have you tried to recreate the OData client with your D365 for Operations url?

@srpraveenkumar
Copy link
Member

Use the custom OData dlls in https://github.com/Microsoft/Dynamics-AX-Integration/tree/master/Packages
This should solve the issue.

@va2010
Copy link

va2010 commented Jul 12, 2018

Hi Priya,

Did you able to resolve this issue? If so how did you manage? I am having the same issue.

@DavidKlempfner
Copy link

I tried those DLLs however I'm now getting:

Could not load file or assembly 'Microsoft.OData.Client' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key.

Any ideas?

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

No branches or pull requests

5 participants