Skip to main content

Notifications

Dynamics 365 Community / Forums / Finance forum / Is there anyone succes...
Finance forum
Suggested answer

Is there anyone success upgrade closedxml 0.94.2 to D365 finance and operations?

Posted on by 315

Good day,

We are now using a very old version of closedxml in d365 f&o, we want to use some new function of this library which exist in the latest version

I get the DLL from NuGet, and get all the dependency library with right version

.NETFramework, Version=v4.6

DocumentFormat.OpenXml (>= 2.7.2)

ExcelNumberFormat (>= 1.0.3)

FastMember (>= 1.3.0)

I got to the DLL and put them into the Bin folder of my solution, full build the solution, also restart the iis express...

But when i execute the excel function with ClosedXML, below error show:

Could not load file or assembly 'DocumentFormat.OpenXml, Version=2.7.2.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I had been try different version of 'DocumentFormat.OpenXml', same error with all version i  was tried...

Is there someone success upgrade ClosedXML to latest version? please help, thanks in advance!

Best Regards,

Roll

  • AX Lover Profile Picture
    AX Lover 315 on at
    RE: Is there anyone success upgrade closedxml 0.94.2 to D365 finance and operations?

    Hi Will,

    I got all the library from NuGet, and put all of them into the Bin folder of my solution, it should be ok, NuGet manager auto download all of the dependencies, and i also check the version one by one.

    41616.png

    Best Regards,

    Roll

  • WillWU Profile Picture
    WillWU 22,350 on at
    RE: Is there anyone success upgrade closedxml 0.94.2 to D365 finance and operations?

    Hi partner,

    Not very sure, this issue may be in a dependency.

    I think you should make sure that all the libraries needed by the DLL have been installed.

  • AX Lover Profile Picture
    AX Lover 315 on at
    RE: Is there anyone success upgrade closedxml 0.94.2 to D365 finance and operations?

    Hi Will,

    I tested but still same error, i tried below two different way to load the library. Any sugguestion? Thanks.

    Assembly.Load("DocumentFormat.OpenXml, Version=2.7.2.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17");

    Assembly.LoadFrom("DocumentFormat.OpenXml.dll");

    Best Regards,

    Roll

  • AX Lover Profile Picture
    AX Lover 315 on at
    RE: Is there anyone success upgrade closedxml 0.94.2 to D365 finance and operations?

    Hi Will,

    Oh... i got your point, let me try it first, thanks

  • AX Lover Profile Picture
    AX Lover 315 on at
    RE: Is there anyone success upgrade closedxml 0.94.2 to D365 finance and operations?

    Hi Nikolaos,

    Thanks your reply, yes, i understand the reason of keep old version of this library, but i think the good way is check the same name library under the Bin folder of customization solution first.

    Just like below, i put all the dependencies library under my solutions Bin folder

    ClosedXML.png

    But now, system seems only check the library blong to "System core level" folder.

    ClosedXML2.png

    @Nikolaos , i know you are the star person of AX world, and you maybe a member of that groups, can you do me a favor to ask the product team to have a look my post?  Thanks ~_~

  • WillWU Profile Picture
    WillWU 22,350 on at
    RE: Is there anyone success upgrade closedxml 0.94.2 to D365 finance and operations?

    Hi Roll,

    Yes , you can create the "CurrentDomain_AssemblyResolve"(by the blog) method in your C# project, then  go to your X++ project and add a reference(your class).

    At last, you can call the  "CurrentDomain_AssemblyResolve" method from X++.

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Is there anyone success upgrade closedxml 0.94.2 to D365 finance and operations?

    You might consider creating an Idea about it, so that Microsoft might pick it up. Or you can also join the Insider program, and get access to R&D Feedback Yammer group where you can discuss with the product team.

    Both can be accessed via this site:

    https://experience.dynamics.com/

    Microsoft indeed has some quite old 3rd party libraries as part of the product. The problem is that they need to care about backwards compatibility, also in cases where partners and customers are using these third party libraries in their solutions. So if they change the libraries, existing customizations and extensions might break.

  • AX Lover Profile Picture
    AX Lover 315 on at
    RE: Is there anyone success upgrade closedxml 0.94.2 to D365 finance and operations?

    Hi Will,

    Thanks your reply, the blog you mentioned is a C# way solution, but we integrate ClosedXML methods to X++ way

    As you said, the DocumentFormat.OpenXml belong to the Application Platform package, seems we can only wait MS to upgrade.

    @D365 finance and operations team, can you get me some comment on this? Thanks.

    Best Regards,

    Roll

  • WillWU Profile Picture
    WillWU 22,350 on at
    RE: Is there anyone success upgrade closedxml 0.94.2 to D365 finance and operations?

    Hi Roll,

    This DLL is belong to the Application Platform package.

    So if you add other version of this DLL, this may cause some problems.

    pastedimage1586242614962v1.png

    But you can try to use Assembly class to load the assemblies that you want, see the blog:

    https://community.dynamics.com/ax/b/ftdynamicsax/posts/dynamics-ax-2012-use-openxml-sdk-for-excel-export-part-3

    Hope this helps.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,888 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,247 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans