web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

OData Client Code Generate

(0) ShareShare
ReportReport
Posted on by 962

Hi All

          Current I download a ODataUility from Git, but when I run the ODataClient.tt, it shows me some errors. The following steps are what I done. In the Final, the issue was solved, but in the steps #7 and #8, I changed private const string Edmx = @"<#= escapedEdmxString #>"; However, I do not know this will affect anything or not?

          Does anyone meet this issue before, and how to solve the issue? Will change Edmx affect the proxy code?

          Is there way we can write the proxy code manually?

  1. Right click ODataClient.tt -> run custom tool, I got error 
  2. pastedimage1574301986818v2.png
  3. I following the online information “https://devblogs.microsoft.com/odata/tutorial-sample-how-to-use-odata-client-code-generator-to-generate-client-side-proxy-class/” to install “OData v4 Client Code Generator” and Update References. Right click ODataClient.tt -> run custom tool, I got error
  4. pastedimage1574302010864v3.png
  5. If I delete the ODataUtility and follow the link https://devblogs.microsoft.com/odata/tutorial-sample-how-to-use-odata-client-code-generator-to-generate-client-side-proxy-class/”. This time the OData is refreshed successfully, but when I build project, it shows me other error
  6. pastedimage1574302040671v4.png
  7. I found this is normal error when using ODataUtility, I tried some ways from Git. One way fix the issue, in “ODataClient.ttinclude”, change
  8. private const string Edmx = @"<#= escapedEdmxString #>";        to         private const string Edmx = @"";             error was fixed.
  9. In all Interface program update the reference Microsoft.OData.Client/Core/Edm/Spatial, rebuild everything successfully.

Best Regards,

JustZM

I have the same question (0)
  • Blue Wang Profile Picture
    on at

    Hi JustZM,

    The only workaround for now for the string limitation that I know is by shrinking the file yourself,Cut the offending generated Edmx string that is the XML string

    Edit the file and remove the edmx string. It should look like this:

    private const string Edmx = @"";

    Please refer this thread:

    [View:https://community.dynamics.com/365/financeandoperations/f/dynamics-365-for-finance-and-operations-forum/365080/getting-error-while-odatautility-build-in-odata-integration-error-cs8103-combined-length-of-user-strings-used-by-the-program-exceeds-allowed-limit-try-to-decrease-use-of-string-literals/962253#962253:750:50]

  • Suggested answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    Hi JustZM ,

    You can also utilize edmx trimmer utility available on github instead of generating huge file.

    github.com/.../EDMXTrimmer

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 565 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans