Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I am trying to integrate a D365 ODATA service with my .NET API using ODataClient.

Procedure I followed:

1. Get the Metadata of the D365 service in xml file.
2. Create a new OdataClient template and change the MetadataDocumentUri to the local Meta data XML file.
3. Created a ODataHelper class where I have defined an init() method to initialize the context and SendingRequest2.
4. While creating the context
C#
Uri oDataUri = new Uri("https://xxxxxxxx.sandbox.ax.dynamics.com/data", UriKind.Absolute);
var context = new Resources(oDataUri);

5. While creating the object of Resources it is getting error "No string associated with token".
6. In stack trace I can found two other issues.
6.1.
[BadImageFormatException: [C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\ce686153\b7cf7da6\assembly\dl3\56b7906b\ab5b9ec6_864ad401\D365Integration.dll] No string associated with token.]

6.2.
[TypeInitializationException: The type initializer for 'GeneratedEdmModel' threw an exception.]


What I have tried:

Not getting any specific ways to solve this error.

Need your experienced opinion to get rid of this.

Thanks.
Posted
Comments
F-ES Sitecore 12-Sep-18 7:24am    
Google "BadImageFormatException" for lots of possible issues it could be. Google "No string associated with token" as well.
Arkadeep De 14-Sep-18 7:45am    
I have already searched on Google, but didn't found any solutions. That's why I have posted here, if you don't have any specific answer, please don't bother to post.

Anyway I solved it. Thanks. :)
F-ES Sitecore 14-Sep-18 8:34am    
If you've tried solutions and they didn't work then post what you've tried in the "What I have tried" box as it stops people suggesting things that didn't work for you. If you're not going to stop people wasting their time then please don't bother to post.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900