DocX icon indicating copy to clipboard operation
DocX copied to clipboard

Docx not working .Net core projects

Open snober opened this issue 6 years ago • 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.

snober avatar May 25 '18 11:05 snober

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.

https://github.com/OfficeDev/Open-Xml-PowerTools/issues/121

tcreek avatar May 27 '18 21:05 tcreek

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

XceedBoucherS avatar Jun 01 '18 19:06 XceedBoucherS

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

tcreek avatar Jun 02 '18 22:06 tcreek

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.

XceedBoucherS avatar Jun 04 '18 12:06 XceedBoucherS

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

Mynken avatar Jun 06 '18 08:06 Mynken

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.

codebymatt avatar Jul 06 '18 12:07 codebymatt

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.

XceedBoucherS avatar Jul 10 '18 14:07 XceedBoucherS

Will this get into community edition?

PrzemyslawKlys avatar Jul 10 '18 14:07 PrzemyslawKlys

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

XceedBoucherS avatar Jul 10 '18 16:07 XceedBoucherS

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.

eskaufel avatar Jul 26 '18 08:07 eskaufel

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?

PrzemyslawKlys avatar Jul 26 '18 08:07 PrzemyslawKlys

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

eskaufel avatar Jul 26 '18 15:07 eskaufel

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 ?

PrzemyslawKlys avatar Jul 26 '18 15:07 PrzemyslawKlys

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.

eskaufel avatar Jul 29 '18 20:07 eskaufel

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

PrzemyslawKlys avatar Jul 29 '18 20:07 PrzemyslawKlys

See also: https://github.com/xceedsoftware/DocX/issues/31

tjrobinson avatar Aug 13 '18 14:08 tjrobinson

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 😊

TylerLeonhardt avatar Oct 05 '18 18:10 TylerLeonhardt

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

XceedBoucherS avatar Nov 05 '18 21:11 XceedBoucherS

Any ETA for that?

tcreek avatar Nov 22 '18 03:11 tcreek

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.

PrzemyslawKlys avatar Nov 22 '18 06:11 PrzemyslawKlys

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

tcreek avatar Nov 22 '18 16:11 tcreek

Looks like this just shipped https://xceed.com/release-notes/#words-net-1.6.19076.19550

jculverwell avatar Jan 31 '19 01:01 jculverwell

@tcreek https://github.com/OfficeDev/Open-XML-SDK

vovikdrg avatar Feb 06 '19 00:02 vovikdrg

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."

tcreek avatar Feb 06 '19 19:02 tcreek

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

hkakutalua avatar May 04 '19 13:05 hkakutalua

Especially since .NET is now available on Linux

tcreek avatar May 05 '19 03:05 tcreek

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

bzapata-thr avatar Oct 23 '19 20:10 bzapata-thr

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

tcreek avatar Oct 23 '19 20:10 tcreek

Still no fix in 1.8.0 :(

Scylla2020 avatar Oct 06 '21 12:10 Scylla2020

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.

tcreek avatar Oct 06 '21 13:10 tcreek