xceedsoftware/DocX

Docx not working .Net core projects

Opened this issue ยท 32 comments

Tried using Docx in .Net core 2 projects like console / Azure functions. Getting below issue

Could not load file or assembly 'System.IO.Packaging, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

I am having the same issue.

I saw another project, OpenXML in which another was complaining about the same issue. Their response was you need a signed certificate to use their project. I am wondering if this one requires the same now.

OfficeDev/Open-Xml-PowerTools#121

Hi,
DocX is currently not working on .Net Core.
This is a feature we are working on.
Thank you.

Thank you for the response. Any ETA on when this will be completed?

Hi,
No. We are going by priority.
This is something important we want to achieve, but no released date has been fixed for now.
Thank you for your patience.

Hi, tried to add System.IO.Packaging form NuGet - this package helped, no errors - the document was successfully created, but zero content inside.

I also worked around the issue by adding System.IO.Packaging manually, with NuGet, but ran into the same problem with zero content. I'm guessing whatever API the DocX lib uses to write to Word files isn't conformant with .NET Standard.

Hi,
yes we are aware of this (zero content).
The priority is this issue is high now.
You should get a response on this in the following weeks/months.
Thank you for your patience.

Will this get into community edition?

No decision has been made related to this at this point. We will keep you up to date.
Thank you.

There is a fork that works with netstandard 2.0, https://github.com/wtulloch/DocX. I suppose you could look into how he solved it.

Well there is this comment: This is a port of the original DocX that has been updated to target .NET Standard 2.0. To limit any changes to the original code base this will currently only work for on Windows OS due to an existing dependency on Windows.Identity. which is a bit killer because the main reason people want NET Standard is for DocX to work on linux right?

I agree that it is far from ideal. In my case it would work, but a general solution is always better.

If you have Windows I assume you have NET 4.5? So Why would it work for you in case of wtulloch version and it wouldn't on Xceeds ?

I have not looked into the difference between the packages. In short I get the same message as @snober. When I add System.IO.Packaging through NuGet or add a reference to the assembly I get the zero content issue.

You're saying this works on Azure/Console and solves snober's problem?

See also: #31

Hope this influences priority a bit but we have a bunch of people that want to move to PowerShell Core (and use this with that) but can't because of this issue.

Looking forward to this ๐Ÿ˜Š

This feature will be available in the next release of "Xceed Words for .NET" : v1.6.
Thank you.

Any ETA for that?

From other threads begining 1st quarter of 2019. Also keep in mind this will be only in pay version. No core support for free one.

That is very sad. I cannot justify spending that kind of money just for my own little personal project

Thanks for that link @vovikdrg . That is very very helpful. Now I can complete my person project without having to fork out a lot of money to do it, or do the deep development of just wanting to manipulate a document

There was an article just about this very issue in the January 2019 edition of Linux Journal. "Some Thoughts on Open Core. Why open core software is bad for the FOSS movement."

Very sad that until now there is no support for .NET Standard.

Especially since .NET is now available on Linux

Apparently this still isn't fixed for the free version (DocX) in the latest stable, 1.4.1.

Correct, as they state it would not be available for the free version any longer. Alternatives have been posted in previous messages.

Still no fix in 1.8.0 :(

Still no fix in 1.8.0 :(

I have moved on to https://github.com/OfficeDev/Open-XML-SDK as @vovikdrg pointed out. It works out just fine.

Still no fix in 1.8.0 :(

I have moved on to https://github.com/OfficeDev/Open-XML-SDK as @vovikdrg pointed out. It works out just fine.

Awesome thanks. Checking it out now

Hi,
"Xceed words for .NET" support .NET standard since v1.6 (Released on January 30, 2019).
"Xceed words for .NET" support .NET5 since v2.0 (Released on July 19, 2021).
You can try those here : https://xceed.com/en/our-products/product/words-for-net
The community edition od DocX do not support those versions for now.
Thank you.