microsoft / Dynamics-AX-Integration

Dynamics AX Integration samples and demos.
286 stars 356 forks source link

System.InvalidOperationException #34

Closed Priyavaratharajan closed 6 years ago

Priyavaratharajan commented 6 years ago

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 commented 6 years ago

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

srpraveenkumar commented 6 years ago

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

va2010 commented 6 years ago

Hi Priya,

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

DavidKlempfner commented 5 years ago

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?